Displaying a meaningfull error when uploading too large a file


FileUploads are limited in size by configuration. We are using default settings 4MB. However som users still persist in uploading larger files and thus end up on a "500"-page even though we clearly display this is not something we accept.

We would like to display a meaningfull error / page to those users. (This article describes the exact same scenario and a solution http://stackoverflow.com/questions/823968/displaying-a-meaningfull-error-when-uploading-too-large-a-file)

However although we catch the exception and the code is executed without errors we are still redirected to the "500"-page as our code is ignored. Since the solution from stackoverflow seems to be working for others we are humbly wondering if this could be a problem specific related to Episerver since we are infact extending EPiServer.Global as in "public class Global : EPiServer.Global".

Is anyone else able to actually redirect a user to a page which may explain that the file was too large? Is anyone else experiencing the same issue as us?

(We DO NOT wish to turn up the max fileupload size to solve the problem.)

Mar 10, 2011 13:43

Is IIS perhaps catching the 500 error for you? See the 404-handler module's configuration documentation for more information: https://www.coderesort.com/p/epicode/wiki/404Handler#IIS56Settings (note that this is for 404 errors, but the same applies for 500 errors).

Hope this helps.


Mar 11, 2011 13:30
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.