Friday, April 9, 2010

Uploading large files in IIS 7

If you are using IIS 7 and you try to upload a file that is too big you will receive this error:

The request filtering module is configured to deny a request that exceeds the request content length.

In IIS 6 you could manipulate the request length by changing the maxRequestLength in the web.config.

   1:  <system.web>
   2:     <httpRuntime maxRequestLength="1000000"/>
   3:  </system.web>

To get the request length raised in IIS7, you have to set the following value in the web.config:

   1:  <system.webServer>
   2:     <security>
   3:        <requestFiltering>
   4:           <requestLimits maxAllowedContentLength="1000000000">
   5:           </requestLimits>
   6:        </requestFiltering>
   7:     </security>
   8:  </system.webServer>

No comments: