December 16, 2014 08:32 by
Peter
By default, IIS can not upload large file size to the web server. For IIS 6 and IIS 7, the default maximum file size for upload is 4 MB and 28.6 MB respectively. IIS 7 will throw a 404 error (HTTP Error 404.13 - CONTENT_LENGTH_TOO_LARGE) if user upload file larger than 30MB. In order to allow for larger file size uploads, a few server changes are required. You have three steps to increase the file upload limit:
1. Modify the maxAllowedContentLength setting in the web.config
You could increase the max file size by modify the maxAllowedContentLength setting in the web.config file: <system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
</system.webServer>
With that maxAllowedContentLength, users can upload files that are 2 GB in size. This setting will work right away without restart IIS services.
2. Edit the request filtering feature settings and therefore the request limits using IIS manager
- Open IIS Manager.
- Choose the web site that you simply wish to configure.
- Check that you're in features view per the button at the lowest of the manager.
- Choose Requests Filtering and open it by double-clicking the icon. The Request Filtering pane displays.
- From the Actions pane on the right hand side of the screen click Edit Feature Settings... link. The Edit Request Filtering Settings window displays.
- In the Request Limits section, enter the appropriate maximum allowed content length (Bytes) then click the OK button.
- Next, Restart IIS.
3. Manually edit the ApplicationHost.config file