zoukankan      html  css  js  c++  java
  • IIS 7 中设置文件上传大小的方法

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

       <system.web>
           <httpRuntime maxRequestLength="1918200" executionTimeout="600"/>        
       </system.web>

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

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

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

       <system.webServer>
           <security>
             <requestFiltering>
               <requestLimits maxAllowedContentLength="1048576000"></requestLimits>
             </requestFiltering>
            </security>
       </system.webServer>

     直接放在<configuration>   </configuration>中即可。

    1048576000是指字节数。

    如果一个文件大小是:31566145字节,
    maxAllowedContentLength设置31576145是可以实现上传的,但是如果设置成31566145,上传会失败。估计是跟上传时请求消息的额外开销有关系。


    最上面的:
    <httpRuntime maxRequestLength="1918200" executionTimeout="600"/>    
    不再有任何用处。
  • 相关阅读:
    css问题
    前端性能优化整理
    算法之排序
    浅谈webpack优化
    js设计模式
    事件模型
    浏览器缓存
    ucGUI 12864 从打点起
    ucGUI例程收藏
    Qt 自动搜索串口号列表
  • 原文地址:https://www.cnblogs.com/songyl/p/5048749.html
Copyright © 2011-2022 走看看