解決辦法
1.在webconfig文件中添加
<system.web> <httpRuntime maxRequestLength="1024000" executionTimeout="3600" /> </system.web>
2.修改maxRequestLength:在web.config中我們修改<system.web></system.web>中的maxRequestLength,表示最大請求長度,單位是kb,默認4M,修改為1G
3.在<system.webServer>添加
<security> <requestFiltering> <requestLimits maxAllowedContentLength="1024000000"></requestLimits> </requestFiltering> </security>
4.修改maxAllowedContentLength:在web.config中我們修改<system.webServer></system.webServer>中的maxAllowedContentLength,表示附件大小上限,單位是字節,默認約30M,修改為1G
注意:maxRequestLength與maxAllowedContentLength的區別
a、前者表示請求長度,后者表示上傳文件的大小;
b、前者單位kb,后者單位字節;
c、前者默認值4M,后者默認值30000000B,約30M;
d、兩者的最大值都為2G
參考網址:https://www.jb51.net/article/88698.htm