IIS 7 默認文件上傳大小時30M 要突破這個限制,須要作以下操做:web
1. 修改IIS的applicationhost.config 打開 %windir%\system32\inetsrv\config\applicationhost.config或者在C:// system32//inetsrv//config//applicationhost.config 找到: <requestFiltering>節點, 這個節點默認沒有 <requestLimits maxAllowedContentLength="上傳大小的值(單位:byte)" /> 元素, 最大值只能是<requestLimits maxAllowedContentLength="4294967295" /> <4GB, 爲這個節點新增以下事例元素:<requestLimits maxAllowedContentLength="2147483647" /> ,上傳的大小將改成2G 注意: %windir%\system32\inetsrv\config\applicationhost.config 文件必定不要用其餘機器的文件替換,不然IIS將沒法啓動 此文件記錄了,當前IIS中全部Site , App pool的信息,還有一些與機器相關的配置。app
2 修改web.config <system.web> <httpRuntime executionTimeout="36000" maxRequestLength="2097151"/> <!--maxRequestLength:上傳的大小,單位K ,executionTimeout:設置超時時間,單位:秒。(默認是90秒) --> </system.web>文件上傳
注意:這個maxRequestLength最大值只能是2097151Kit