MVC3中上传大文件,发现文件超过10M就不能上传。文件上传的限制也改了,仍然不起作用。解决办法如下:
第一步:在web.config中添加:
<system.web> <!-- The request length is in kilobytes, execution timeout is in seconds --> <httpRuntime maxRequestLength="100240" executionTimeout="500" /> </system.web>
第二步:在web.config中添加:
<system.webServer> <security> <requestFiltering> <!-- The content length is in bytes --> <requestLimits maxAllowedContentLength="150485760"/> </requestFiltering> </security> </system.webServer>
时间: 2024-09-29 22:17:38