zoukankan      html  css  js  c++  java
  • IIS 之 通过 Web.config 修改文件上传大小限制设置方法

      在IIS 6.0中,不设置默认大小为4M,设置文件上传大小的方法,maxRequestLength(KB),executionTimeout(毫秒),配置如下节点:

    <system.web>
        <httpRuntime maxRequestLength="102400" executionTimeout="300000"/>        
    </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>

      以下方法是不正确或不好的方法:

      (1)修改:“C:WindowsSystem32inetsrvconfigschemaIIS_schema.xml”文件,但这样确实能做到,但如果在系统安装补丁时,有可能对这个文件进行覆盖,设置就会失效,需重新设置;

      (2)修改:

      

     
  • 相关阅读:
    梯度下降法实现python[转载]
    PAT Maximum Subsequence Sum[最大子序列和,简单dp]
    PAT Sign In and Sign Out[非常简单]
    PAT 1015 Reversible Primes[求d进制下的逆][简单]
    outlook 召回邮件 (zz)
    The Microsoft.Jet.OLEDB.4.0 provider is not registered on the local machine (zz)
    Determine Microsoft Database AccessEngine Version (zz)
    企业的十三中死法
    c#事件学习
    20071017我们的新家
  • 原文地址:https://www.cnblogs.com/xinaixia/p/5690502.html
Copyright © 2011-2022 走看看