加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – maxAllowedContentLength不适用于IHttpHandler IIS7

发布时间:2020-12-16 09:50:16 所属栏目:asp.Net 来源:网络整理
导读:我有ASP.NET IHttpHandler模??块来处理文件上传.我在配置文件中将文件大小限制设置为50mb system.webServer security requestFiltering requestLimits maxAllowedContentLength="52428800" / /requestFiltering /security /system.webServer 但是在上传13mb
我有ASP.NET IHttpHandler模??块来处理文件上传.我在配置文件中将文件大小限制设置为50mb

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

但是在上传13mb文件时仍然会出错.

System.Web.HttpException (0x80004005): Maximum request length exceeded.

如何增加默认允许的文件大小?

解决方法

在web应用程序的web.config下使用以下内容

<httpRuntime maxRequestLength="52428800" />

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读