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