ich auf eine Fehlerseite direkte Benutzer versuchen, wenn die maximale Größe Fileupload excedds.For diese iam, das Folgende tun:Umleitung auf Fehler bei Überschreiten Fileupload Größe
public void Init(HttpApplication application)
{
application.BeginRequest += new EventHandler(application_BeginRequest);
}
void application_BeginRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
if (context.Request.ContentLength > 4096000)
{
context.Response.Redirect("~/Error.aspx");
}
}
public void Dispose()
{
}
Aber mit einer Größe von mehr als die Datei hochladen max filesize zeigt einen "connection reset" Fehler an. Wie soll ich das machen?
Ich legte einen Debugger auf context.Response.Redirect ("~/Error.aspx"); es kommt zu diesem Punkt. –
Bitte lesen Sie meine andere Antwort ;-) – volpav