① 如何設置伺服器iis上傳文件大小
在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>
② 怎麼修改iis最大上傳文件大小
IIS7.0默認限制上傳文件大小為30000000位元組(約28.6M)。打開C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml,找到如下內容:
<element name="requestLimits">
<attribute name="maxAllowedContentLength" type="uint" defaultValue="30000000" />
<attribute name="maxUrl" type="uint" defaultValue="4096" />
...
③ 如何解除IIS的文件上傳限制
解除IIS的文件上傳限制的方法如下:
編輯IIS配置資料庫:
停止IIS Admin Service服務:
修改IIS_schema.xml文件:
修改web.config文件:
重啟IIS服務:
注意:在修改這些配置文件之前,請確保你有足夠的許可權,並且已經備份了相關文件,以防修改過程中出現意外情況導致服務中斷。