解决FileUpload上传大文件报错

<system.webServer>
    <security>
        <requestFiltering>
        <requestLimits maxAllowedContentLength="262144000" />
        </requestFiltering>
    </security>
</system.webServer>
 
<system.web>
    <httpRuntime maxRequestLength="262144000" executionTimeout="20000"/>
</system.web>

ASP.NET为我们提供了文件上传服务器控件FileUpload,默认情况下可上传的最大文件为4M,如果要改变可上传文件大小限制,那么我们可以在web.config中的httpRuntime元素中添加maxRequestLength属性设置大小,同时为了支持大文件上传超时可以添加executionTimeout属性设置超时时间

原文地址:https://www.cnblogs.com/ButterflyEffect/p/10207570.html