Solved

How manage HTTP Error 404.13 during File Upload

Posted on 2011-03-22
1
2,393 Views
Last Modified: 2012-05-11
Hello Experts,
I created  an ASP.NET application that use FileUpload control.
I fixed maximun dimension of upload to 20Mb and everything work well.

If the user try to upload a file more than 20Mb correctly appears a WEB Page that show the HTTP Error 401.13.

I would like capture the error and redirect the browser to my customized web page.
I have tried to capture the error in page_error event, in global.asax Application_error, forcing the redirect using  Response.Redirect() or Server.Execute() but  they seem to be ignored and the standar Error page continues to appear.

Someone may suggest me how to manage the correct error catch and redirect?

Thanks
Erik
0
Comment
Question by:ErikIce
1 Comment
 
LVL 11

Accepted Solution

by:
lenordiste earned 500 total points
ID: 35193357
You ll have to work on the HttpApplication.EndRequest of your exception handler and check the response status code (401.13 in your case) and then take the necessary decisions (redirect to a custom error page for instance). You might also want to check for the request's URL to make sure you are handling the FTP file size problem.

This thread here is spot-on, you can easily use the answer and modify it to your needs:
http://stackoverflow.com/questions/567273/where-do-i-catch-and-handle-maxallowedcontentlength-exceeded-in-iis7
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
This is an introductory video for CloudBerry Managed Backup. You will learn how to sign up with the service and get started in a few minutes.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now