在IIS 6.0中設(shè)置文件上傳大小的方法,就是配置如下節(jié)點(diǎn):
代碼如下:
<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="600"/>
</system.web>
但在IIS7中,設(shè)置如上設(shè)置后,不管設(shè)置多大數(shù)值,最大上傳了限制為30M
還要進(jìn)行如下設(shè)置才能正確:
方法1:
appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost
在IIS服務(wù)器的命令行執(zhí)行如上命令,注意修改上面的網(wǎng)站名稱和上傳文件大小
方法2:
在web.config中加入如下配置:
代碼如下:
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1048576000"></requestLimits>
</requestFiltering>
</security>
</system.webServer>
以下方法是不正確或不好的方法
網(wǎng)上還有很多方法要去修改:“C:/Windows/System32/inetsrv/config/schema/IIS_schema.xml”文件,但這樣確實(shí)能做到,但如果在系統(tǒng)安裝補(bǔ)丁時(shí),有可能對(duì)這個(gè)文件進(jìn)行覆蓋,讓設(shè)置失敗;
另外,也有說修改:
新聞熱點(diǎn)
疑難解答
圖片精選