Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Customize Error Message caused by uploading big file? (No DNS error)

Reply
Thread Tools

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

 
 
henry
Guest
Posts: n/a
 
      02-21-2004
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
displayed.
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.

Henry
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGF2aWQgQ29lLCBNQ1A=?=
Guest
Posts: n/a
 
      02-23-2004
Yes, it is possible

put the upload inside of a try/catch block

tr

// 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.
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net 0 12-26-2008 09:29 AM
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net Web Controls 0 12-26-2008 06:11 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Python 0 12-24-2008 07:35 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Ruby 0 12-24-2008 05:07 AM
Customize Error Message Alex ASP .Net 1 08-28-2007 10:18 PM



Advertisments