How-to enable large file uploads in IIS7
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.