I am using an asp:FileUpload control on my web site. I have my web.config file set to limit requests to 100mb to prevent users from uploading files > 100MB. I tried checking the FileUpload.PostedFile.ContentLength to make sure that this is <= MB in order
to give the user a friendly error message for when they try to upload files larger than that, but the page errors out before it even gets there with a Maximum request length exceeded error. How can I catch this error so that I can give the user a friendly
error message?
System.Web.HttpException (0x80004005): Maximum request length exceeded. at System.Web.HttpRequest.GetEntireRawContent() at System.Web.HttpRequest.GetMultipartContent() at System.Web.HttpRequest.FillInFormCollection() at System.Web.HttpRequest.get_Form() at System.Web.HttpRequest.get_HasForm() at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) at System.Web.UI.Page.DeterminePostBackMode() at System.Web.U ...
Go to the complete details ...