zoukankan      html  css  js  c++  java
  • asp.net上传文件,IIS【请求筛选模块被配置为拒绝超过请求内容长度的请求 】的解决办法

    解决方法

    1. 修改IIS的applicationhost.config

         a.文件位置: %windir%/system32/inetsrv/config/applicationhost.config

         b.找到 <requestFiltering> 节点

         c.为这个节点添加如下元素:<requestLimits maxAllowedContentLength="2147483647" /> (上传的大小将改为2G)

           注:该节点下默认没有 <requestLimits maxAllowedContentLength="上传大小的值(单位:byte)" /> 元素。

    2. web.config中添加如下内容

      <configuration>

        <system.web>

           <httpRuntime maxRequestLength="2097151" executionTimeout="120"/>

        </system.web>

      </configuration>

    复制代码说明:
    httpRuntime 配置 ASP.NET HTTP 运行时设置,以确定如何处理对 ASP.NET 应用程序的请求。
    maxRequestLength (指示 ASP.NET 支持的最大文件上载大小)
    指定输入流缓冲阈值限制(以 KB 为单位)。此限制可用于防止拒绝服务攻击;例如,因用户向服务器发送大型文件而导致的拒绝服务攻击。
    默认值为 4096 (4 MB),最大值只能是2097151K。
    executionTimeout:指定在被 ASP.NET 自动关闭前,允许执行请求的最大秒数。默认90秒。
    只有当 compilation 元素中的调试属性为 False 时,此超时属性才适用。若要帮助避免在调试期间关闭应用程序,请不要将此超时属性设置为较大值。

    3. web.config中,把以下内容加在<system.webServer>节点

     <security>

       <requestFiltering >

           <requestLimits maxAllowedContentLength="2147483647" ></requestLimits>

        </requestFiltering>

      </security>


    上述中maxAllowedContentLengt是以BK为单位。

  • 相关阅读:
    openwrt官方固件怎么中继网络
    hibernate 映射一对多
    jsp连接access数据库
    表单判断值是否为空
    eclipse java ee jsp tomcat Server文件夹给删了,怎么办?
    Provided id of the wrong type for class pojo.Books. Expected: class java.lang.Integer, got class java.lang.Long
    myeclipse创建hibernate工程
    Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
    Mac 挂载树莓派nfs
    树莓派集群实践——nfs
  • 原文地址:https://www.cnblogs.com/weekzero/p/2914143.html
Copyright © 2011-2022 走看看