Fixing File Upload Size Limit in IIS 7

Windows 2008 Server and IIS 7 proved to be a real challenge in moving my old IIS 5 applications that were running on Windows XP Pro. Just when I thought everything was running smoothly, I ran into a file size upload limit which I thought I had already adjusted.

In the older IIS, I added the following code to <system.web> in the web.config file in the web application’s folder:
  maxRequestLength=”2000000″ />
This allows a file upload of 2,000,000 kilobytes and it will time out after 100,000 seconds, or 27.8 hours. I think that if someone spends more than 28 hours uploading a file, they should send me a DVD instead.
Adjusting File Size Limit in IIS 7
The problem is that in IIS 7 on Windows 2008 Server, the web application will reject any file that is larger than 30 MB. This is a default limitation of IIS. You can increase the maximum file size by adding the following code to <system.webServer> in the web.config file:
  <requestLimits maxAllowedContentLength=”2000000000″ />
With the above maxAllowedContentLength, users can upload files that are 2,000,000,000 bytes in size. This setting will work right away without restart IIS services.

12 thoughts on “Fixing File Upload Size Limit in IIS 7”

  1. Thanks! Everyone else is having you edit the metabase with cryptic commands that alter the system configs while you have show a simple change to the web.config file. Much superior way!

  2. Learning how web.config works will help you administer IIS better. There isn’t much available online with this information.

  3. Thank you, way to go. Why ever I have to change that one file a hundred times, is way beyound me. always having to alter my files (espescially the web.config) after writing them in that visual studio development server is a pain.

  4. A simple solution….
    Open IIS 7 SnapIn
    Select the website you want enable to accept large file uploads.
    In the main window double click ‘Request filtering’
    once the window is opened you may see on top a list of tabs eg: file name extensions, rules, hidden segments and so on…
    regardless the tab you select, in the main window rightclick and select “Edit Feature Settings” and modify the “Maximum allowed content length (bytes)”
    Now you can upload files larger than 30 MB ….


Leave a Comment