L
Lloyd Dupont
I'm experimenting with an upload file page.
I have a few HtmlInputFile on it.
While testing it, I selected a 12MBfile, click "upload".
I was think I am safe as (at last in the code) I don't upload file bigger
than 1MB.
At the top of my request there is a module where I access the request and
while querying a parameter:
string var = context.Request["param"]
I get the following exception:
===
System.Web.HttpException was unhandled by user code
Message="Maximum request length exceeded."
Source="System.Web"
ErrorCode=-2147467259
StackTrace:
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_Item(String key)
at LangModule.HTranslate(Object sender, EventArgs e) in
f:\MyWork\eCookBook\WebSite\asp.net\App_Code\LangModule.cs:line 36
at
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
===
What could I do to get around that?
I mean, I don't want to download 12MB file (I just skip the upload and write
a error status message) and I don't want them to cause my application to
fail....
Perhaps some Javascript?
I have a few HtmlInputFile on it.
While testing it, I selected a 12MBfile, click "upload".
I was think I am safe as (at last in the code) I don't upload file bigger
than 1MB.
At the top of my request there is a module where I access the request and
while querying a parameter:
string var = context.Request["param"]
I get the following exception:
===
System.Web.HttpException was unhandled by user code
Message="Maximum request length exceeded."
Source="System.Web"
ErrorCode=-2147467259
StackTrace:
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_Item(String key)
at LangModule.HTranslate(Object sender, EventArgs e) in
f:\MyWork\eCookBook\WebSite\asp.net\App_Code\LangModule.cs:line 36
at
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
===
What could I do to get around that?
I mean, I don't want to download 12MB file (I just skip the upload and write
a error status message) and I don't want them to cause my application to
fail....
Perhaps some Javascript?