By default, IIS 7.0+ has restrictions on the maximum file size that can be uploaded to the web server. If these restricted attributes are not modified, you will experience failures when attempting to send larger sized data through the web server. This article discusses the three attributes below, listed with their default values. For the purposes of this article, I am setting all of the values to 1073741824 Bytes, or 1 Gigabyte.

 

  • maxRequestEntityAllowed (200,000 bytes)
  • Maximum Allowed Content Length (30,000,000 bytes)
  • UploadReadAheadSize (49,152 bytes)

 

maxRequestEntityAllowed

This attribute specifies the maximum number of bytes allowed in the body of an ASP request. If you are using a classic ASP script to upload data, this attribute will be relevant.

 

  1. Open Internet Information Services (IIS) Manager under Administrative Tools
  2. Highlight the relevant website
  3. Double click ASP from the Features View
  4. Expand the Limits Properties Branch
  5. Locate and change the Maximum Requesting Entity Body Limit to “1073741824”

 

Maximum Allowed Content Length

This attribute specifies the maximum length of an HTTP request. While the limit is 30MB by default, we should change this value to match the above.

 

  1. Open Internet Information Services (IIS) Manager under Administrative Tools
  2. Highlight the relevant website
  3. Double click Request Filtering from the features view
  4. Click the Edit Feature Setting link on the right hand side pane
  5. Locate and change the Maximum allowed content length to “1073741824”

 

UploadReadAheadSize

You must have both of the following role services for IIS to be able to make this attribute change

 

  • IIS 6 Management Compatibility
  • IIS 6 Scripting Tools

 

If SSL is enabled on the website in question, long HTTP requests may cause HTTP 413 errors if the entire request cannot be fit into the SSL Preload.

Issue the following from an administrative command prompt to increase the limit of the SSL Preload:

 

cscript c:\inetpub\adminscripts\adsutil.vbs set w3svc/1/uploadreadaheadsize 1073741824

 

After making all of the proposed changes, it is recommended to restart the IIS service