Created By  inflectra.adam Friday, November 10, 2017

By default, IIS web server allows for limited file size to be uploaded to the web server. For IIS 6 and IIS 7, the default maximum file upload size is 4 MB and 28.6 MB respectively. IIS 7 returns a 404 error (HTTP Error 404.13 - CONTENT_LENGTH_TOO_LARGE) if someone uploads something larger than 30MB. In order to allow for larger file size uploads, a few server changes are required.

When you try and upload a large file (over the size limit in IIS) you will see an error message that looks something like:

Request timed out.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: Request timed out.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[HttpException (0x80004005): Request timed out.]

You have 3 available options to increase the file upload limit:

1. Modify the maxAllowedContentLength setting in the web.config

You can increase the maximum file size by modify the maxAllowedContentLength setting in the web.config file:

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

With the above maxAllowedContentLength, users can upload files that are 2 GB in size. This setting will work right away without restart IIS services.

2. Edit the request filtering feature settings and the request limits using IIS manager

  1. Open IIS Manager.
  2. Select the website that you want to configure.
  3. Make sure you are in Features View per the button at the bottom of the manager.
  4. Select Requests Filtering and open it by double-clicking the icon. The Request Filtering pane displays.
  5. From the Actions pane on the right hand side of the screen click Edit Feature Settings... link. The Edit Request Filtering Settings window displays.
  6. In the Request Limits section, enter the appropriate Maximum allowed content length (Bytes) and then click the OK button.
  7. Restart IIS.

 

3. Manually edit the ApplicationHost.config file

  1. Click Start. In the Start Search box, type Notepad. Right-click Notepad, and then click Run as administrator.
  2. On the File menu, click Open. In the File name box, type %windir%\system32\inetsrv\config\applicationhost.config, and then click Open.
  3. In the ApplicationHost.config file, locate the <requestLimits> node.
  4. Remove the maxAllowedContentLength property. Or, add a value that matches the size of the Content-Length header that the client sends as part of the request. By default, the value of the maxAllowedContentLength property is 30000000. 

    For example, modify the following configuration data inside the <requestFiltering> section.
    <requestLimits maxAllowedContentLength ="<length>" />
  5. Save the ApplicationHost.config file.
Attachments

Selected files will be attached to any email sent on saving ticket.

file selected files selected  () Delete Selected

  • Created:
  • by:

Select files to upload

Or drag and drop files here

Uploading …
Done!
Upload More?
There was an error.
Try again?

Save to upload the selected file(s)

Article Info
  • Last Updated: 11/10/2017
  • Article ID: KB306
  • Views: 364