469,270 Members | 1,531 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Customize Error Message caused by uploading big file? (No DNS error)

Hi all,

When user upload a file, there is a size limit (default is 4M). And we
can change this size limit by changging the config file.
If a user upload a file bigger than this size, an DNS error will be
Now my question is whether we can customize this error message?
Displaying a DNS error page is quite misleading to normal user.
I would rather display a page saying "The file you upload should not
exceed 4M" and then put a link there for the user to go back to
previous page.
Is this possible?

Thank you.

Nov 18 '05 #1
1 1082
Yes, it is possible

put the upload inside of a try/catch block


// uploa

catch(Exception ex) // or the more specific DNS Exception you receiv

// if it is a DNS Exceptio
lblErrors.Text = "The file could not be uploaded. Files over 4mb are not allowed. Please check the file size and try again.
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mark | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.