zoukankan      html  css  js  c++  java
  • 通过fileupload上传文件超出大小

    配置文件

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

    1 <configuration>
    2   <system.web>
    3      <httpRuntime maxRequestLength="2097151" executionTimeout="120"/>
    4   </system.web>
    5 </configuration>
    View Code

    说明:
    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>节点
     

    1 <security>
    2 <requestFiltering >
    3 <requestLimits maxAllowedContentLength="2147483647" ></requestLimits>
    4 </requestFiltering>
    5 </security>
    6  
    7 上述中maxAllowedContentLengt是以BK为单位。
    View Code

    注:部分资料参考网络资料

  • 相关阅读:
    581. 最短无序连续子数组
    217. 存在重复元素
    189. 旋转数组
    169. 多数元素
    122. 买卖股票的最佳时机 II
    119. 杨辉三角 II
    118. 杨辉三角
    外显子分析思路总结(Exome Sequencing Analysis review)
    宁夏采样记20181129
    haploview出现“results file must contain a snp column”的解决方法
  • 原文地址:https://www.cnblogs.com/happygx/p/3248832.html
Copyright © 2011-2022 走看看