Monday, January 5, 2009

Catch the exception caused by massive file size upload in asp.net 2.0

Put the code in Global.asax under c:\Inetpub\wwwroot\wss\VirtualDirectories\80

void Application_Error(object sender, EventArgs e)

{

//To catch the error caused by masssive file size upload more than 4MB.

HttpException httpEx = Server.GetLastError() as HttpException;

if(httpEx.ErrorCode == -2147467259)

{

HttpContext.Current.Server.ClearError ();

HttpContext.Current.Server.Transfer("ErrorMessage.aspx");

}

}

Friday, January 2, 2009

Few Interesting Things about IIS6

  1. While uploading, IIS6 never returns any error until it completely absorbs the uploaded file.