How-to enable large file uploads in IIS7

Published Fri, Mar 13 2009 10:57 AM | Ramon Smits

We have migrated from IIS6 to II7 and today we had some problems with large file uploads which we didn’t have with ASP.NET on IIS6. The web application was already configured to allow large file uploads:

<system.web>
    <httpRuntime maxRequestLength="153600" executionTimeout="900" />
</system.web>

So WTF is happening? Well IIS7 request filtering was kicking in and we needed to configure it and this can be done too in the web.config:

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

But this still didn’t work for us because the default permission in IIS7 is that applications are not allowed to alter this setting. Configuring the setting with appcmd on an elevated command prompt made it all work again:

appcmd set config "wms/wmsdev" -section:requestFiltering -requestLimits.maxAllowedContentLength:157286400

Be aware though that maxRequestLength is specified in kilobytes and maxAllowedContentLength in bytes.

Filed under: ,

Comments

# Dylan Barber said on November 17, 2009 5:45 PM:

We found if you install the IIS Admin Pack then you can edit it right from the IIS admin windows in IIS7

Leave a Comment

Name:  
Website:

Please add 3 and 5 and type the answer here: