Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

System.Web.HttpException: Maximum request length exceeded.

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.HttpException: Maximum request length exceeded.     at System.Web.HttpRequest.GetEntireRawContent()     at System.Web.HttpRequest.GetMultipartContent()     at System.Web.HttpRequest.FillInFormCollection()     at System.Web.HttpRequest.get_Form()     at System.Web.HttpRequest.get_HasForm()     at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)     at System.Web.UI.Page.DeterminePostBackMode()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     --- End of inner exception stack trace ---     at System.Web.UI.Page.HandleError(Exception e)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest()     at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)     at System.Web.UI.Page.ProcessRequest(HttpContext context)     at ASP.loggedin_mycaravans_aspx.ProcessRequest(HttpContext context)     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Can someone shed some light on this error.

Is there a simple fix?
ASKER CERTIFIED SOLUTION
Avatar of Juan_Barrera
Juan_Barrera
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml
scm0sml

ASKER

ok i have gone with:
<httpRuntime maxRequestLength="10000"/>

the default was 4096kb.

reckon this will do the job?
You might also want to increase executionTimeout to a large value.
Well, it depends, are you working with uploading/downloading large files?
Avatar of scm0sml

ASKER

the only file a user would be able to upload is images, i was suprised that one would have been bigger than that default value but i guess it is possible.
That's a possible culprit. Estimate the maximum length of the files the user can upload, and set the MaxRequestLength accordingly.
Avatar of scm0sml

ASKER

ok in that case 10000kb should be ample for now, when i get time may develop some checking before the upload the limit the size of the image that can be uploaded.
Sounds good :)