I have a MVC 3 site with some big forms. They have just got a file upload part, which has caused some problems. For small files, all is well, but for larger files I get HTTP 413 Request entity too large. The form itself is about 10-15 kB, and the uploaded files are excel files, which are typically around 50 kB.
I tried finding a way to increase this limit, and some reading suggests that adding
<system.webServer>
<serverRuntime maxRequestEntityAllowed="104857600"/>
</system.webServer>
to the web.config file would fix this. However, if I do that, I instead get HTTP 500 “This configuration section cannot be used at this path. This happens when the section is locked at a parent level.”.
I have read about how that can in turn be fixed by changing the applicationHost.config file, but that is not feasible in my situation. We’re 15 developers developing locally (using IIS Express from Visual studio), and then have about 10 servers that are used for testing and production. Requiring all of these to be patched from outside source control will become a mess real soon. What can be done to fix it?
If it is II7 you need to set:
Here is a link explaining Large File Upload in IIS7