Click here to Skip to main content
15,846,899 members
Articles / Web Development / IIS
Tip/Trick

IIS 7 needs extra configuration to allow large file uploads

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
14 Apr 2010CPOL 34.5K   3   5
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Freestyle Interactive Ltd
United Kingdom United Kingdom
I'm a lead developer for Freestyle Interactive Ltd where we create many wonderful websites built on Microsofts ASP.Net and Ektron CMS.

I've been developing .Net applications (both Windows and Web) since 2002.

Comments and Discussions

 
Generalcool post.. really helped me lot Pin
dhinakaran.pc30-May-11 19:47
dhinakaran.pc30-May-11 19:47 
GeneralReason for my vote of 5 I love these simple articles solving... Pin
xkrja11-Apr-11 4:18
xkrja11-Apr-11 4:18 
GeneralI had the same problem. My configuration was missing the &l... Pin
RagesFury8-Apr-11 6:46
RagesFury8-Apr-11 6:46 
GeneralReason for my vote of 5 I had the same problem. My configura... Pin
RagesFury8-Apr-11 6:43
RagesFury8-Apr-11 6:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.