【问题标题】:HttpException (0x80004005): Maximum request length exceededHttpException (0x80004005): 超出最大请求长度
【发布时间】:2017-04-30 15:21:39
【问题描述】:

抱歉,StackOverflow,我知道这已经被问过了,并找到了很多答案,我几乎尝试了所有,并且在配置上似乎没问题,但抛出异常,所以不得不带到这里。

我限制用户最多上传 8 张照片,因为看起来超出了最大请求长度。

我引用自:

Maximum value of maxRequestLength?

Maximum request length exceeded

这是在我的配置文件中:

  <location path="MyHome.aspx">
 <system.web>
  <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
 </system.web>
 </location>
 <system.webServer>
    <defaultDocument>
        <files>
            <add value="Home.aspx" />
        </files>
    </defaultDocument>
  </system.webServer>
<system.webServer>
<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="1073741824" />
  </requestFiltering>
 </security>
</system.webServer>

有人可以帮我解决这个问题,我做错了什么,所以我的文件没有上传并抛出异常?

谢谢你,对不起我的英语不好。

【问题讨论】:

    标签: asp.net iis-7 web-config


    【解决方案1】:

    您的 System.Web 元素似乎在 Location 元素下,请确保它在 Configuration 元素下。

    类似这样的:

    <configuration>
    <system.web>
    <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
    </system.web>
    </configuration>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-12-30
      • 1970-01-01
      • 2011-04-20
      • 2015-11-02
      • 1970-01-01
      相关资源
      最近更新 更多