我们用IIS发布的Bs项目,如果进行文件上传,在上传文件的时候,无法上传文件大小超过4M的文件

设置文件上传大小的方法,就是修改项目的web.config配置

在项目中的web.config文件中,添加如下节点

 <system.web>
    <!-- maxRequestLength:解决上传文件4M限制 -->
    <httpRuntime maxRequestLength="999999" executionTimeout="50000"   />   
 </system.web>

那么在IIS7.0这样设置后,无论maxRequestLength多大, 最大只能30M, 还要配置一下

在web.config添加如下配置

 <system.web>
    <!-- maxRequestLength:解决上传文件4M限制 -->
    <httpRuntime maxRequestLength="999999" executionTimeout="50000"   />   
 </system.web>

在加上

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

Ps:

IIS6.0 设置上传文件超过限制(4M),已解决本人上传文件限制问题,IIS7.0方法未测试,来源于:

http://www.cnblogs.com/LifelongLearning/archive/2011/12/06/2278247.html

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-06-12
  • 2021-09-30
猜你喜欢
  • 2022-12-23
  • 2021-06-20
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
相关资源
相似解决方案