graceful file upload limit error?

Discussion in 'ASP .Net' started by Tom Kaminski [MVP], Jul 19, 2004.

  1. Tom Kaminski [MVP], Jul 19, 2004
    #1
    1. Advertising

  2. Tom Kaminski [MVP]

    bruce barker Guest

    no. the only way a webserver can stop an upload is to close the tcp
    connection, as the protocol is so simple. IE just shows a generic message,
    other browsers may be more informative.

    -- bruce (sqlwork.com)



    "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:cdh2n5$...
    > Is there anyway to gracefully catch a file upload limit error? When the
    > limit is exceeded, IE displays a generic "Cannot find server or DNS error"
    > message.
    >
    > --
    > Tom Kaminski IIS MVP
    > http://www.microsoft.com/windowsserver2003/community/centers/iis/
    > http://mvp.support.microsoft.com/
    > http://www.iisfaq.com/
    > http://www.iistoolshed.com/ - tools, scripts, and utilities for running

    IIS
    > http://www.tryiis.com
    >
    >
     
    bruce barker, Jul 19, 2004
    #2
    1. Advertising

  3. Tom Kaminski [MVP]

    Shan Plourde Guest

    I have a series of .net file upload pages i've written that validate the
    posted file size, before it is saved. Keep in mind that it is posted to
    the server side and the server side is then validating the file
    size...not the most efficient solution but it works. I can show you my
    approach if that's specifically what you're looking for.
    Shan

    Tom Kaminski [MVP] wrote:

    >Is there anyway to gracefully catch a file upload limit error? When the
    >limit is exceeded, IE displays a generic "Cannot find server or DNS error"
    >message.
    >
    >
    >
     
    Shan Plourde, Jul 19, 2004
    #3
  4. Tom Kaminski [MVP]

    Joe Fallon Guest

    3rd party controls can do it (for a price).
    Nothing built -in.

    One trick is tell the user of the site that the limit is 6MB.
    Then set your web.config file to 8MB.

    Allow the file to be fully uploaded, then check its size and if it is
    greater than 6MB send your friendly error message.
    Obviously, you get the "standard" screen if the file is over 8MB.
    But you get the idea.
    --
    Joe Fallon




    "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:cdh2n5$...
    > Is there anyway to gracefully catch a file upload limit error? When the
    > limit is exceeded, IE displays a generic "Cannot find server or DNS error"
    > message.
    >
    > --
    > Tom Kaminski IIS MVP
    > http://www.microsoft.com/windowsserver2003/community/centers/iis/
    > http://mvp.support.microsoft.com/
    > http://www.iisfaq.com/
    > http://www.iistoolshed.com/ - tools, scripts, and utilities for running

    IIS
    > http://www.tryiis.com
    >
    >
     
    Joe Fallon, Jul 20, 2004
    #4
  5. Tom Kaminski [MVP], Jul 20, 2004
    #5
  6. "Shan Plourde" <> wrote in message
    news:nWUKc.677$...
    > I have a series of .net file upload pages i've written that validate the
    > posted file size, before it is saved. Keep in mind that it is posted to
    > the server side and the server side is then validating the file
    > size...not the most efficient solution but it works. I can show you my
    > approach if that's specifically what you're looking for.


    Are you saying this will catch it before the maxRequestLength is reached?
    So if the file is 10 MB and maxRequestLength is 5 MB, your code will display
    an "error" message?
     
    Tom Kaminski [MVP], Jul 20, 2004
    #6
  7. Tom Kaminski [MVP]

    Shan Plourde Guest

    Sorry I misunderstood you. I have a similar design to what you have
    right now. So I have the same issue that you have I would imagine.

    Tom Kaminski [MVP] wrote:

    > Are you saying this will catch it before the maxRequestLength is reached?
    >
    >So if the file is 10 MB and maxRequestLength is 5 MB, your code will display
    >an "error" message?
    >
    >"Shan Plourde" <> wrote in message
    >news:nWUKc.677$...
    >
    >
    >
    >>I have a series of .net file upload pages i've written that validate the
    >>posted file size, before it is saved. Keep in mind that it is posted to
    >>the server side and the server side is then validating the file
    >>size...not the most efficient solution but it works. I can show you my
    >>approach if that's specifically what you're looking for.
    >>
    >>

    >
    >
     
    Shan Plourde, Jul 20, 2004
    #7
    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. Jacob H

    Graceful failures

    Jacob H, Dec 29, 2003, in forum: Python
    Replies:
    3
    Views:
    343
    Samuel Walters
    Dec 31, 2003
  2. Alexander Staubo

    Portable, generic, graceful termination

    Alexander Staubo, Sep 28, 2004, in forum: Python
    Replies:
    0
    Views:
    303
    Alexander Staubo
    Sep 28, 2004
  3. MickeyBob

    Graceful detection of EOF

    MickeyBob, Oct 7, 2004, in forum: Python
    Replies:
    20
    Views:
    906
    Follower
    Oct 14, 2004
  4. lovecreatesbeauty

    How to write a small graceful gcd function?

    lovecreatesbeauty, Jul 15, 2006, in forum: C Programming
    Replies:
    73
    Views:
    1,634
    ozbear
    Jul 26, 2006
  5. mmacrobert
    Replies:
    1
    Views:
    338
    Victor Bazarov
    Aug 4, 2005
Loading...

Share This Page