Click here to Skip to main content
Click here to Skip to main content

Tagged as

IIS 7 needs extra configuration to allow large file uploads

, 13 Apr 2010
Rate this:
Please Sign up or sign in to vote.
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 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)

Share

About the Author

Martin Jarvis
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.
Follow on   Twitter

Comments and Discussions

 
AnswerThis problem occurs because the client request contains a Content-Length header that is larger than the value that is specified. By default, IIS7 limits file upload to 30MB. Pinmembersamunder27-Apr-14 23:06 
Generalcool post.. really helped me lot Pinmemberdhinakaran.pc30-May-11 18:47 
GeneralReason for my vote of 5 I love these simple articles solving... Pinmemberxkrja11-Apr-11 3:18 
GeneralI had the same problem. My configuration was missing the &l... PinmemberRagesFury8-Apr-11 5:46 
GeneralReason for my vote of 5 I had the same problem. My configura... PinmemberRagesFury8-Apr-11 5:43 

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

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

| Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 14 Apr 2010
Article Copyright 2010 by Martin Jarvis
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid