I receive the following error when trying to upload any file that is larger than 4 MB. Is there something I have not configured correctly?
My Resource setup in config.ascx is:
ResourceType type;
type = ResourceType.Add("Client Folders");
type.Url = BaseUrl;
type.Dir = BaseDir == "" ? "" : BaseDir;
type.MaxSize = 0;
type.AllowedExtensions = new string[] { };
type.DeniedExtensions = new string[] { };
The error message is:
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.HttpException (0x80004005): 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) 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.ckfinder_core_connector_aspx_connector_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Fri, 06/10/2011 - 23:52
#1
Re: ASP.NET - Maximum request length exceeded
This error was due to IIS's preset upload limit.
Adding the following to web.config resolved the issue.
<system.web>
<httpRuntime executionTimeout="100000" maxRequestLength="214748364" />
</system.web>
Please also see this link:
Please also see this link: http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx
It contains very good explanation of what might be wrong when uploads don't work in ASP.NET.
NOTE: If you use IIS7 please don't forget to check "What About IIS7" section.