Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 1379
Product
FileUp
Title
IIS 7.0 and above return a 404.13 response status when uploading files larger than 28.6 MB in a FileUp application
Problem
When trying to perform an upload of more than 28.6 MB to a FileUp or FileUpEE site hosted on IIS 7.0 or above, I receive a 404.13 response status.
Solution
In IIS 7.0, Microsoft introduced a new security feature that allows you to set limits on the size of requests that can be accepted by a web page. Among other settings, the maxAllowedContentLength setting allows you to set the maximum length of content in a request, in bytes. The default value of this setting is 30,000,000 bytes, or roughly 28.6 MB.

In FileUp and FileUpEE, this means that uploads may be restricted to fewer than 28.6 MB by default. If this content length limit is exceeded, IIS will return a 404.13 response.

You can use XFile to bypass this setting by using chunked transfer encoding. For those not using XFile, however, this is not an option.

Fortunately, Microsoft provides a method for altering this setting through the IIS Manager by increasing the maxAllowedContentLength setting, as noted in their Request Filtering documentation page:

http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering

You can increase the maxAllowedContentLength setting in one of three ways: using Microsoft's IIS 7/7.5 UI, using the AppCmd.exe command line tool, or editing the web.config file.

Using the IIS Manager 7.0/7.5 UI
You can set the maxAllowedContentLength for the File or folder level using the IIS Manager UI.
  1. If you are using IIS 7.0, you may need to download the Microsoft Administration Pack for IIS 7.0, which includes a user interface for request filtering:

    http://www.iis.net/download/AdministrationPack

  2. In IIS Manager, navigate to the level at which you would like to set the maxAllowedContentLength, then select Request Filtering under the IIS heading of the Features View.

  3. In the Actions Pane, select Edit Feature Settings to bring up the Edit Request Filtering Settings dialog.

  4. Under Request Limits, set the Maximum allowed content length (Bytes) to the desired value.
Using AppCmd.exe
You can set the maxAllowedContentLength for the Application or server level using the IIS command line tool.
  1. You may wish to add the path to AppCmd.exe to your PATH environment variable if you have not already done so. It is not placed there by default.


  2. Use the following command to set the maxAllowedContentLength for an Application within IIS:

    appcmd set config "WebSite/Application"
      /section:requestfiltering
      /requestlimits.maxallowedcontentlength:[new value]

    You could also omit the application name in order to apply the setting to the entire server:

    appcmd set config
      /section:requestfiltering
      /requestlimits.maxallowedcontentlength:[new value]
Using the web.config
You can use a web.config file to change the maxAllowedContentLength setting on the file, folder, or application level. These changes apply for both ASP and ASP.NET applications.

  1. In ASP: Create a new web.config file in a text editor with the following content.

    In ASP.NET: Add the requestFilter sections to your existing web.config:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
       <system.webServer>
          <security>
             <requestFiltering>
                <requestLimits
                 maxAllowedContentLength="[New Value]" />
             </requestFiltering>
          </security>
       </system.webServer>
    </configuration>


  2. Save the file as web.config and place it in the folder on which you wish the new maxAllowedContentLength setting applied.
Created : 4/6/2011 6:32:20 PM (last modified : 4/6/2011 6:32:19 PM)
Rate this article!
Comments