How-to Allow Large File Uploads in IIS7

In IIS6 you allowed large file uploads to an ASP.NET website by adding the following key to the web.config:

<httpRuntime maxRequestLength="102400"
     useFullyQualifiedRedirectUrl="true"
     executionTimeout="900" />

You would just set the maxRequestLength to a number of kilobytes that is greater than the size of the largest file you plan to upload.  We recently moved a site from a server running IIS6 to IIS7.  After the move, when our website users were having problems uploading large files.  They would submit a form, the progress bar would move for a while, then they would get a 404 page not found error.  The form was posting back to itself, so the page did exists.  Turns out we needed to add an additional web.config setting that’s new to IIS7. [more]

    <system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength=" 104857600"/>
            </requestFiltering>
        </security>
    </system.webServer>

The maxAllowedContentLength in this settings is specified in bytes.

Note: These settings exist to help revent denial of service attacks, so keep that in mind when you pick your limits.

Networking IIS7 Windows 2008 Server