HttpRuntimeSection.MaxRequestLength 属性,请求的最大大小(以千字节为单位)。 默认大小为 4096 KB (4 MB)
<system.web> <httpRuntime maxrequestLength="2097152" executionTimeout="3600"/> <!--maxRequestLength就是文件的最大字符数,最大值不能超过2个G左右,executionTimeout是超时时间--> <compilation debug="true" targetFramework="4.0" /> </system.web>
MaxAllowedContentLength属性,以字节为单位,您想要启用附件的大小。默认 30000000B,约30M。
<security> <requestFiltering> <!--限制上传大小为2G--> <requestLimits maxAllowedContentLength="2147483647" /> </requestFiltering> </security>