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

Discussion in 'ASP .Net' started by henry, Feb 21, 2004.

  1. henry

    henry Guest

    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
    henry, Feb 21, 2004
    #1
    1. Advertising

  2. 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.
    }
    =?Utf-8?B?RGF2aWQgQ29lLCBNQ1A=?=, Feb 23, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shaguf
    Replies:
    0
    Views:
    329
    Shaguf
    Dec 24, 2008
  2. Shaguf
    Replies:
    0
    Views:
    432
    Shaguf
    Dec 26, 2008
  3. Shaguf
    Replies:
    0
    Views:
    219
    Shaguf
    Dec 26, 2008
  4. Sam Roberts
    Replies:
    0
    Views:
    194
    Sam Roberts
    Mar 20, 2005
  5. Shaguf
    Replies:
    0
    Views:
    202
    Shaguf
    Dec 24, 2008
Loading...

Share This Page