文件上传大小限制、超时时间配置


1.在<system.web>节点内配置

<httpRuntime executionTimeout="3600" maxRequestLength="1048576" requestValidationMode="2.0"/>

属性说明:

executionTimeout:超时时间,单位:秒

maxRequestLength:允许上传文件大小,单位:KB。默认上传的文件大小为4M,超出报错。

requestValidationMode="2.0":必要,否则报错:Internal Server Error

 

2.在<system.webServer>节点内配置

    <security>  
      <requestFiltering allowDoubleEscaping="true">            
          <requestLimits maxAllowedContentLength="1073741824"></requestLimits>  
      </requestFiltering>  
    </security>

属性说明:

maxAllowedContentLength:允许上传文件大小,单位:B。默认上传的文件大小为30M,超出报错。最多支持4GB(4294967295)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM