Solved

How manage HTTP Error 404.13 during File Upload

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Contant UI messages in .NET 1 41
Wpf develop 5 35
help with issues with ReportViewer in VS2015 5 24
Getfiles in vb.net 28 24
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

12 Experts available now in Live!

Get 1:1 Help Now