the http protocol does not support stopping an upload and returnning an
error to the browser. when asp.net detects the upload is too larger (by
counting how many bytes its received), it kills the connection to the
browser to stops the upload.
so while you can catch the error on the server and log it, you can not send
any message back to the browser, because the request failed (from the
browsers point of view) and the browser prints the error message of its
choice.
-- bruce (sqlwork.com)
"SalP" <sa*************@yahoo.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
I'm using VS 2003.
I'm uplading a file using Input Type='File' .PostedFile. etc.
How does one trap the error when the file is larger than the 4 Meg
default? Try/Catch doesn't work. I get the "This page cannot be
displayed screen". I also tried adding a Page Error handler which
didn't work. I want to tell the user that the file size is too large.
Thanks,
Sal