Solved

How manage HTTP Error 404.13 during File Upload

Posted on 2011-03-22
1
2,426 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Latest thoughts on C# utilizing Mono on Linux vs .NET on Windows? 5 64
Add a Condition in ASP Repeater 6 34
Finding the IIS version 5 22
VS 2017 18 49
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 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