I am developing an ASP.NET site with C # in IIS 7, but I hope for an answer that will apply to IIS 6. Part of this site is the ability to upload up to 5 images at a time. I have a good algorithm for resizing an image that loads to the optimal size and ratio.
So, the only size limit I have is during bootstrap. I modified my web.config to increase the packet limit from 4 MB to 32 MB. For the most part, this takes care of my problems.
My question arises in rare cases when a user tries to download more than my limit. I can raise the limit, but there is always a chance that the user can find 5 files that are larger. If the user selects files that are larger, my try / catch block does not handle the error. The error comes from IIS.
So, how can I catch an error in C # code, where can I make changes to my ASP.NET interface to inform the user about choosing small files instead of seeing an unpleasant error screen?
source
share