471,893 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,893 software developers and data experts.

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 1135
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 YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.