1. How to increase the maximum file upload size limit when using Microsoft IIS 7





    How to increase the maximum file upload size limit when using Microsoft IIS 7


     

    Beginning with version 7.0, IIS has a built-in HTTP content size limiter, and the default limit is 30,000,000 bytes (about 28.6MB). To increase this limit, one must set the requestLimits' “maxAllowedContentLength” to the desired limit. This can be accomplished one of three ways:

     

    1.   Modify the IIS configuration file directly

    2.   Use the IIS manager to change the value (requires Microsoft Administration Pack for IIS 7.0 be installed)

    3.   Use the command-line IIS configuration update commands to change the file

     

    The configuration file to be updated is:

     C:\Windows\System32\inetsrv\config\applicationHost.config

        (also known as:)

     %SystemRoot%\System32\inetsrv\config\applicationHost.config

     

    Note: the file is in an X32/X64 protected area, and will require that an X64-comprehending text editor be used. The built-in notepad.exe for Windows Server 2008 X64 works; most other aftermarket text editors (such as NotePad++ or NoteTabLite) are only X32 capable, and will not allow you to open the file: they will complain that the file does not exist, and will not show the file in the “Open file...” file browser dialog.

     

    The path to the attribute which is to be changed is:

    /configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength

     

    In unmodified form, the requestLimits section does not exist. It seems that the default 30,000,000 limit is coded into the IIS 7 service.

     

    The command-line IIS configuration update command is:

    %systemroot%\System32\inetsrv\appcmd set config -section:requestFiltering -requestLimits.maxAllowedContentLength:50000000

    (Note: command above has been wrapped)

     

    The above command sets the limit to 50,000,000 bytes (about 47.7MB) for all applications/virtual hosts on the system. Setting individual limits for applications is possible, but is outside the scope of these instructions.

     

    Once the maxAllowedContentLength value has been set/changed, recycle the IIS server using the IIS management console.

     

    For more information please see:

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

     

    Back to top