IIS限制ASP.Net 文件上传大小解决方案,修改IIS7/7.5配置

当在web.config中设置了 httpruntime 后仍是没法成功上传大文件,则要修改IIS的系统configweb

 

IIS 7 默认文件上传大小是30M 要突破这个限制:windows

修改IIS的applicationhost.configapp

    打开 c:/windows/system32/inetsrv/config/applicationhost.config      找到: <requestFiltering>节点,   这个节点默认没有 <requestLimits maxAllowedContentLength="上传大小的值(单位:byte)" /> 元素,IIS 7和IIS 7.5上测试过  最大值只能是<requestLimits maxAllowedContentLength="4294967295" />  <4GB,      为这个节点新增以下事例元素:<requestLimits maxAllowedContentLength="2147483647" /> ,上传的大小将改成2G 注意: %windir%/system32/inetsrv/config/applicationhost.config 文件必定不要用其余机器的文件替换,不然IIS将没法启动 此文件记录了,当前IIS中全部Site , App pool的信息,还有一些与机器相关的配置。测试

配置好后重启IIS。文件上传

相关文章
相关标签/搜索