How-to enable large file uploads in IIS7

By ramon
March 13, 2009

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:

    <httpRuntime maxRequestLength=”153600″ executionTimeout=”900″ />

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:

                <requestLimits maxAllowedContentLength=”157286400″ />

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.

Comments: 1

  1. Ramon Smits says:

    You are right about the error as “wms/wmsdev” was the website that existed on that server. You need to target your own specific website there 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Recent Posts
  • Recent Comments
  • Archives
  • Categories
  • Meta