reg uploading huge files.

M

muthu

hi friends,
I am developing ASP.NET application which allows user to upload the
files upto 10 MB.
But if the user selects the file to upload more than 10 MB the
application crashes with error.
I have tried the follwoing to prevent the crash.

if (System.IO.Path.GetFileName(Request.Path).ToLower() ==
"default.aspx")
{
System.Exception appException = Server.GetLastError();
HttpException chkException = (HttpException) appException;
if ((chkException.GetHttpCode() == 500 ||
chkException.GetHttpCode() == 400) && chkException.ErrorCode ==
-2147467259)
{
Session.Add("ImageTooLarge",true);
Server.ClearError();
Response.Redirect("Default.aspx");
}

}

But it didnt help me.
Also I have used Custom errors

<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="400" redirect="UploadError.htm" />
<error statusCode="500" redirect="UploadError.htm" />
</customErrors>

This also not helped me from that error.

Friends please help me what to do..
Thanks and regards,
Muthu Kumaran.D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top