“Maximum request length exceeded” in C#

In C# ASP.NET, I kept getting the following error message:

HttpException (0×80004005): Maximum request length exceeded.

To make matters worst, this is a type of error that catch does not recognize. In the end, I found a simple solution.

By default, the request length of any request is 2048kb. To increase the length, you need to add the following script to your web.config file and specify a length.

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="32768" />
    </system.web>
</configuration>

With this solution, my web application is now able to accept files larger than 2mbs (and can actually accept a much larger 32mb). This application is an intranet web application used by trusted users.

Share and Enjoy:
  • Digg
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • MySpace
  • Netvibes
  • Reddit
  • StumbleUpon
You can leave a response, or trackback from your own site.

2 Responses to ““Maximum request length exceeded” in C#”

  1. Kevin says:

    This is very interesting.

  2. forumsglobe says:

    interesting topic… nice

Leave a Reply