Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

IIS 7 needs extra configuration to allow large file uploads

0.00/5 (No votes)
14 Apr 2010 1  
Whilst uploading a large (70MB) file to an IIS 7 website I got a 404 error….which was odd, uploading a file in a postback shouldn’t give me that. I know that file exists!On further investigation it turns out it was actually a 404.13 error from the Request Filtering feature of the Integrated...
Whilst uploading a large (70MB) file to an IIS 7 website I got a 404 error….which was odd, uploading a file in a postback shouldn’t give me that. I know that file exists!

On further investigation it turns out it was actually a 404.13 error from the Request Filtering feature of the Integrated Pipeline (More Info[^]).

To fix this I needed to add some additional configuration to the <system.webServer> element on top of the <httpRuntime> modifications – note the subtle change of units!

XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <!-- maxRequestLength and requestLengthDiskThreshold is in Kilobytes-->
        <httpRuntime maxRequestLength="204800" requestLengthDiskThreshold="204800" />
    </system.web>
    <system.webServer>
        <security>
            <requestFiltering>
                <!-- maxAllowedContentLength is in Bytes not Kilobytes -->
                <requestLimits maxAllowedContentLength="204800000" />
            </requestFiltering>
        </security>
    </system.webServer>
</configuration>

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here