Tuesday, 13 April 2010

IIS 7 Gotcha! 404.13 Not Found – Uploading Large Files with Integrated Pipeline!

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: http://bit.ly/dkZiYr). 

To fix this I needed to add some additional configuration to the <system.webServer> element on top of the <httpRuntime> modifications – not the subtle change of units!

   1: <?xml version="1.0" encoding="utf-8"?>
   2: <configuration>
   3:     <system.web>
   4:         <!-- maxRequestLength and requestLengthDiskThreshold is in Kilobytes-->
   5:         <httpRuntime maxRequestLength="204800"
   6:                      requestLengthDiskThreshold="204800" />
   7:     </system.web>
   8:     <system.webServer>
   9:         <security>
  10:             <!-- maxAllowedContentLength is in Bytes not Kilobytes -->
  11:             <requestFiltering>
  12:                 <requestLimits maxAllowedContentLength="204800000" />
  13:             </requestFiltering>
  14:         </security>
  15:     </system.webServer>
  16: </configuration>

No comments:

Post a Comment

Got something to say? Let it out then!
Comments are moderated, so it may take a while to for them to be displayed here!