IIS 7 中设置文件上传大小限制设置

来源:互联网 发布:改不了淘宝店名 编辑:程序博客网 时间:2024/06/05 11:29

为了这个问题找这个bug找了整整一天,谨以此文哀悼一下我逝去的24小时

在IIS 6.0中设置文件上传大小的方法,就是配置如下节点:

   1: <system.web>
   2:       <httpRuntime maxRequestLength="1048576" executionTimeout="600"/>        
   3:     </system.web>

 

但在IIS7中,设置如上设置后,不管设置多大数值,最大上传了限制为30M

还要进行如下设置才能正确:

方法1:

appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost

在IIS服务器的命令行执行如上命令,注意修改上面的网站名称和上传文件大小

方法2:

在web.config中加入如下配置:

   1: <system.webServer>
   2:     <security>
   3:       <requestFiltering>
   4:         <requestLimits maxAllowedContentLength="1048576000"></requestLimits>
   5:       </requestFiltering>
   6:     </security>
   7:   </system.webServer>
0 0
原创粉丝点击