We have set a fixed limit on the filesize of uploads on our site - below the size of the default asp.net and iis setting.
I have a simple catch setup in Application_BeginRequest that catches this (it's not excat since it checks the ContentLength including all other form data but it's good enough). I want to either resume processing of the page the user tried to upload to, or as a fallback plan redirect the user to a page, explaining that the filesize was too big (we already have a subtitle explaining this, but you know users - 'they don't need to read no stinking subtitles').
So what's the problem? Well it seems that my Response was already sent to the user - a 404 explaining that the page could not be found. I don't want this behaviour, i want to flush this response, since it's not the one i want the user to see - i want to show something else - build my own response, redirect or just process the page they were supposed to get anyways.
I think the problem might still be IIS rejecting the request/post since the file is bigger than what IIS wants. I really do dig this - a mad user trying to upload a 20meg picture shouldn't be allowed to DoS the IIS to its knees, but is this it? Or do i get a chance to intercept this response to the user - instead of increasing the max size on the IIS and thus spending bandwith on receiving this file, i just want to identify this post as 'being too big' and sending an apropriate response back to the user.