M
moondaddy
I have an application where users need to upload images and in my web.config
file I have a setting like this:
<httpRuntime maxRequestLength="512" />
Which restricts image larger than 500k from being uploaded. I'm also using
the HtmlInputFile control to do the uploading. My problem is that when the
user's file size exceeds 512k, the page immediately redirects to the "The
page cannot be displayed" error page which is very confusing. The use will
think that their image is corrupt, or the website has a nasty bug in it.
The way this should be handled is instead of showing the nasty "The page
cannot be displayed" page, show a friendly page telling the user that they
exceeded the file limit and to upload a smaller image.
Is there a way to intercept this and do a redirect? and if not, is there
any other way to handle this elegantly?
file I have a setting like this:
<httpRuntime maxRequestLength="512" />
Which restricts image larger than 500k from being uploaded. I'm also using
the HtmlInputFile control to do the uploading. My problem is that when the
user's file size exceeds 512k, the page immediately redirects to the "The
page cannot be displayed" error page which is very confusing. The use will
think that their image is corrupt, or the website has a nasty bug in it.
The way this should be handled is instead of showing the nasty "The page
cannot be displayed" page, show a friendly page telling the user that they
exceeded the file limit and to upload a smaller image.
Is there a way to intercept this and do a redirect? and if not, is there
any other way to handle this elegantly?