How to find/display the Upload File limits on IIS with ASP.NET?
Posted
by NVRAM
on Stack Overflow
See other posts from Stack Overflow
or by NVRAM
Published on 2010-06-03T19:38:55Z
Indexed on
2010/06/03
19:44 UTC
Read the original article
Hit count: 201
I have a web service on which the end users will be uploading ZIP archives that can be very large (one test file is over 200MB). I'd like to handle oversized files proactively and size-limited upload failures gracefully.
Since the web app will be deployed on customers' machines, so I cannot easily ensure that the configuration matches any fixed size. I've documented how to use the appcmd command for them to set the requestLimits.maxAllowedContentLength value beyond the 30MB default.
But I'd like to handle it in the web app; I'm hoping for two things:
To show the current limit on the page where they initiate the file upload, something along the lines of:
Each file upload is limited to 15MB. If your archive is larger, (etc., etc., etc.)
To give a meaningful error when that size is exceeded. Currently, it takes a long time for the data to be sent, and then I see a misleading 404 page.
Any thoughts?
© Stack Overflow or respective owner