Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum request length exceeded exception

I'm trying to upload a 20 meg file using the upload control and it's working fine on visual studio's built in webserver but once I publish it to the production server (which I have no access to) I keep getting the following error :

Server Error in '/' Application.
--------------------------------------------------------------------------------

Maximum request length exceeded. 
Description: An unhandled 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.  

Stack Trace: 


[HttpException (0x80004005): Maximum request length exceeded.]
   System.Web.HttpRequest.GetEntireRawContent() +11140903
   System.Web.HttpRequest.GetMultipartContent() +72
   System.Web.HttpRequest.FillInFormCollection() +245
   System.Web.HttpRequest.get_Form() +119
   System.Web.HttpRequest.get_HasForm() +11072199
   System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +124
   System.Web.UI.Page.DeterminePostBackMode() +83
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +270



--------------------------------------------------------------------------------

I've added the following to my system.web node so i don't know what the real issue is.

<httpRuntime executionTimeout="800" maxRequestLength="51200" />

Any direction on this would be very helpful.

like image 919
zSynopsis Avatar asked Nov 04 '10 16:11

zSynopsis


People also ask

How do you handle Maximum request length exceeded?

The default maximum filesize is 4MB - this is done to prevent denial of service attacks in which an attacker submitted one or more huge files which overwhelmed server resources. If a user uploads a file larger than 4MB, they'll get an error message: "Maximum request length exceeded." Server Error in '/' Application.

What is Max request length?

HttpRuntime maxRequestLength Use the maxRequestLength of the httpRuntime element. The default size is 4096 kilobytes (4 MB).

What is maxAllowedContentLength in web config?

The maxAllowedContentLength Request Filter is the maximum size of the http request, measured in bytes, which can be sent from a client to the server. Configuring this value enables the total request size to be restricted to a configured value.


1 Answers

If config file change doesn't work, please try to update property httpRuntime executionTimeout="9200" maxRequestLength="200000"> directly from IIS.

For reference: maxRequestLength

like image 151
Raj Avatar answered Nov 26 '22 07:11

Raj