When running a website on Windows 2008 with IIS 7, you may have difficulties uploading large files to the website. The following error occurs
404 – File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
To enable uploading files, larger than 28MB, you have to change a setting in IIS 7. By the way, actually the limit is approximately 28,6 MB, because the limit of “maxAllowedContent Length” is 30000000 bytes).
To change the maximum upload setting, named “maxAllowedContent Length”, do the following:
- Log on to the server that holds the IIS website, and then click Start, click Programs, click Administrative Tools, click Internet Information Services (IIS) Manager
- Expand the website that you want to increase the maxAllowedContent Length
- Double click the Request Filtering icon in the main window
Note: if you don’t have the Request Filtering icon, you need to install it through the Add Roles option. A manual to add this functionality can be found here: http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/hiddenSegments
- Click the Hidden Segment Tab
- Right click web.config and click Edit Feature Setting
- A new window named Edit Request Filtering Settings, appears.
- Under Request Limits heading. enter a new larger value in the Maximum allowed content length (Bytes) box. For example “2000000000”, that allows you to upload files up to 1900 MB.
- Click OK to apply the change. The new setting immediately takes effect. You do not have to restart the website.