Works as advertised, but when the upload gets over 5MB, there is this immediate IIS error that -it seems- you cannot make any prettier for the user. Or can you? I have been looking at IIS forums, and what's suggested is creating a global.asax file and redirecting in the Application_Error. It didn't work. Am I doing something toally wrong? Or is it that you have to adapt recompile umbraco for this?
I wonder if I shouldn't start thinking about setting the limit to 1GB (thus opening the door a bit for DOS attacks) and let the usercontrol throw exceptions instead. Has anyone solved this? We expect people using the site who don't know what a megabyte is.
Below is the code for the HttpModule. The error message sent back is rather specific for my particular situation, responding to an Ajax call.
John Ligtenberg / Royal Tropical Institute / Amsterdam
using System; using System.Web; public class MaxRequestLengthErrorHandlerModule : IHttpModule { public MaxRequestLengthErrorHandlerModule() { }
public String ModuleName { get { return "MaxRequestLengthErrorHandlerModule"; } }
// In the Init function, register for HttpApplication // events by adding your handlers. public void Init(HttpApplication application) { application.BeginRequest += (new EventHandler(this.Application_BeginRequest)); application.EndRequest += (new EventHandler(this.Application_EndRequest)); }
How to implement: custom error page after exceeding httpRuntime maxRequestLength
I'm using 4.0.2.1 with IIS 5.1 on XP.
In our appication, users can upload larger files. Of course you can set the limit in the web.config:
<httpRuntime maxRequestLength="5250" executionTimeout="360"/>
Hello Henk,
The only solution which eventually worked for me was making an HttpModule, in the App_Code directory. I'm using 4.7
In web.config, underI added the following line:
Below is the code for the HttpModule. The error message sent back is rather specific for my particular situation, responding to an Ajax call.
John Ligtenberg / Royal Tropical Institute / Amsterdam
is working on a reply...