Setting IIS and ASP.NET POST Size Request Limits

IIS Setting: Request Limits

The first setting is the IIS Request Limit settings which is installed as part of the Request Filtering IIS Module. IIS Request Filtering is an optional IIS feature, but it is a required install feature when you install ASP.NET in IIS so you can assume it will be installed if ASP.NET is enabled in IIS.

The following sets the max POST buffer size to 500 megs. The value is specified in bytes.

<configuration>
    <system.webServer>
        <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="500000000" />
          </requestFiltering>
        </security>
    <system.webServer>
</configuration>    

ASP.NET Setting: httpRuntime maxRequestLength

ASP.NET uses the httpRuntime element to control a number of runtime related features including the allowed inbound request length. The inbound data size is checked very early in the request cycle and makes a request fail immediately.

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="500000000"  executionTimeout="120" />
    </system.web>
<configuration>

Source: https://webconnection.west-wind.com/docs/_4lp0zgm9d.htm

 

Advertisements

IIS 7.5 – uploadReadAheadSize

IIS 7.5 – uploadReadAheadSize

A developer recently reported a problem that when a customer attempted to upload an attachment, they would sometime receive the error:

The page was not displayed because the request entity is too large.

In our case it did not include an error number, but it will sometimes include the error number:

HTTPS 413

The fix for us is listed below:

How to set the uploadReadAheadSize in IIS 7.5

  1. Launch “Internet Information Services (IIS) Manager”
  2. Expand the Server field
  3. Expand Sites
  4. Select the site you want to make the modification for.
  5. In the Features section, double click “Configuration Editor”
  6. Under “Section” select: system.webServer>serverRuntime
  7. Modify the “uploadReadAheadSize” section
  8. Click Apply
– Note that the value is in BYTES
Source: http://tips4sysadmins.blogspot.com/2012/12/iis-75-uploadreadaheadsize.html