Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC - System.Web.HttpException: Maximum request length exceeded [duplicate]

Tags:

asp.net-mvc

I have the following code in my web.config...

  <system.webServer>
    <modules>
      <remove name="FormsAuthentication" />
    </modules>

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

    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

I have a page where I allow a user to upload up to five images. In testing this, I am attempting to upload five images, totalling ~16MB and I'm getting the maximum request length exceeded error. Is there something else I need to set?

like image 974
Randy Minder Avatar asked Jun 26 '26 22:06

Randy Minder


1 Answers

Try:

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="1073741824" />
    </system.web>
    <system.webServer>
       <!-- Your other settings -->
    </system.webServer>
</configuration>

In addition to what you have set. You probably also want to look at the executiontimeout (also a property of httpRuntime).

like image 156
NikolaiDante Avatar answered Jun 29 '26 16:06

NikolaiDante



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!