Sunday, July 21, 2013

Server Error in '/' Application, Maximum request length exceeded

Below is one of the common error developers get when they try to upload huge files using ASP.NET application.

Error description:

Server Error in '/' Application.

Maximum request length exceeded.
Description: An unhanded exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Maximum request length exceeded.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


users are trying to upload huge files which is more than the default size allowed by .NET Framework.


Change below settings in web.config depends on the IIS version you are using.

For IIS6

        <httpRuntime maxRequestLength="1048576" />

For IIS7

         <requestLimits maxAllowedContentLength="1073741824" />

You may change the values depends on the file size you want to allow the users to upload.

Try to run your application and upload some files!!!

No comments: