2016-12-15 117 views
0

對不起,StackOverflow,我知道這已經被問到,並且發現了很多答案,並且我嘗試了幾乎所有的東西,並且似乎配置正常,但是拋出了異常,所以不得不把它帶到這裏。HttpException(0x80004005):超過最大請求長度

我限制用戶上傳最多8張照片hince看起來像最大請求長度超過。

我引用自:

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> 

有人可以幫我在這,我在做什麼錯了,所以我的文件沒有上傳並拋出異常?

謝謝你,對不起我的英文不好。

回答

1

您的System.Web元素似乎位於Location元素下,請確保其位於Configuration元素下。

事情是這樣的:

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