IIS 6和IIS 7 中设置文件上传大小限制设置方法,两者是不一样的

时间:2021-08-24 16:27:44

在IIS 6.0中设置文件上传大小的方法,只要设置httpRuntime就可以了

 <system.web>
<httpRuntime executionTimeout="36000" maxRequestLength="2097151"/>
<!--maxRequestLength:上传的大小,单位K ,executionTimeout:设置超时时间,单位:秒。(默认是90秒) -->
</system.web>

但在IIS7中,设置如上设置后,不管设置多大数值,最大上传了限制为30M,还需要下面的设置。

<system.webServer>
<!--文件上传大小配置(针对IIS7),maxAllowedConenLength 单位byte-->
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1048576000"></requestLimits>
</requestFiltering>
</security>
</system.webServer>

如果上传了超过限制大小的文件,在kindeditor的上传会报错404页面。