Connecting Tech Pros Worldwide Forums | Help | Site Map

graceful file upload limit error?

Tom Kaminski [MVP]
Guest
 
Posts: n/a
#1: Nov 18 '05
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/windowsserv...y/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
Guest
 
Posts: n/a
#2: Nov 18 '05

re: graceful file upload limit error?


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$q4u2@kcweb01.netnews.att.com...[color=blue]
> 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/windowsserv...y/centers/iis/
> http://mvp.support.microsoft.com/
> http://www.iisfaq.com/
> http://www.iistoolshed.com/ - tools, scripts, and utilities for running[/color]
IIS[color=blue]
> http://www.tryiis.com
>
>[/color]


Shan Plourde
Guest
 
Posts: n/a
#3: Nov 18 '05

re: graceful file upload limit error?


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:
[color=blue]
>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.
>
>
>[/color]

Joe Fallon
Guest
 
Posts: n/a
#4: Nov 18 '05

re: graceful file upload limit error?


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$q4u2@kcweb01.netnews.att.com...[color=blue]
> 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/windowsserv...y/centers/iis/
> http://mvp.support.microsoft.com/
> http://www.iisfaq.com/
> http://www.iistoolshed.com/ - tools, scripts, and utilities for running[/color]
IIS[color=blue]
> http://www.tryiis.com
>
>[/color]


Tom Kaminski [MVP]
Guest
 
Posts: n/a
#5: Nov 18 '05

re: graceful file upload limit error?


"Joe Fallon" <jfallon1@nospamtwcny.rr.com> wrote in message
news:ePQkxpfbEHA.1356@TK2MSFTNGP09.phx.gbl...[color=blue]
> Obviously, you get the "standard" screen if the file is over 8MB.[/color]

That's what we're trying to avoid ...

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/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


Tom Kaminski [MVP]
Guest
 
Posts: n/a
#6: Nov 18 '05

re: graceful file upload limit error?


"Shan Plourde" <------@---.net> wrote in message
news:nWUKc.677$yhj1.9@news04.bloor.is.net.cable.ro gers.com...[color=blue]
> 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.[/color]

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
Guest
 
Posts: n/a
#7: Nov 18 '05

re: graceful file upload limit error?


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:
[color=blue]
> 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" <------@---.net> wrote in message
>news:nWUKc.677$yhj1.9@news04.bloor.is.net.cable.r ogers.com...
>
>
>[color=green]
>>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.
>>
>>[/color]
>
>[/color]

Closed Thread