在IIS 6.0中设置文件上传大小的方法,就是配置如下节点:
<system.web>
<httpRuntime executionTimeout="72000" maxRequestLength="2097151" />
</system.web>
但在IIS7中,设置如上设置后,不管设置多大数值,最大上传了限制为30M
还要进行如下设置才能正确:
在web.config中加入如下配置:
<system.webServer>
<!--文件上传大小配置(针对IIS7)-->
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1048576000"></requestLimits>
</requestFiltering>
</security>
</system.webServer>