locked
IIS10 Max file upload size RRS feed

  • Question

  • User309339835 posted

    Hi, reading a lot of conflicting information regarding this, but trying to upload file sizes larger than 2GB using IIS with PHP. ALL of the PHP side has been configured appropriately, with the following configured in the webconfig:

    <requestFiltering>
                    <requestLimits maxAllowedContentLength="4294967295" />
                </requestFiltering>

    <system.web>
            <httpRuntime maxRequestLength="2147483647" />
        </system.web>

    I believe the above are the max setting (apologies not a web administrator) allowed for IIS? However, seem to hit 2Gb hard limit on uploads. Is it correct that IIS has a limit of 2GB, while asp.net 4GB? Is there anything I am overlooking? If indeed 2Gb is the limit, then at least I can draw a line under this and work with that. 

    Thanks in advance for any further information and advice. 

    Wednesday, May 5, 2021 1:26 PM

All replies

  • User1065476709 posted

    Hi buc1001,

    <requestFiltering>
                    <requestLimits maxAllowedContentLength="4294967295" />
                </requestFiltering>

    According to microsoft docs maxAllowedContentLength has type uint, its maximum value is 4294967295 bytes = 4 GB.

    According to microsoft docs maxRequestLength has type kilobytes, its maximum value is 2147483647 kilobytes= 2 TB.

    Best regards,

    Sam

    Thursday, May 6, 2021 7:10 AM
  • User309339835 posted

    Hi Samwu,

    Thanks for the information. I can take it from this that with the above settings both at max values and still hitting 2Gb max file upload size limit, then this is a hard limit within IIS? Tried numerous configurations without success. Either requires other settings changing that I am not aware of, or that is the limit for IIS. Back to the drawing board I guess. 

    Regards

    Thursday, May 6, 2021 1:50 PM
  • User1065476709 posted

    Hi buc10001,

    Thanks for the information. I can take it from this that with the above settings both at max values and still hitting 2Gb max file upload size limit, then this is a hard limit within IIS? Tried numerous configurations without success. Either requires other settings changing that I am not aware of, or that is the limit for IIS. Back to the drawing board I guess. 

    Have you set up Request Filtering? The setting Maximum allowed content length in Request Filtering will also affect the size of the uploaded file in iis.

    1. Open IIS Manager.
    2. Select the website that you want to configure.
    3. Select Requests Filtering and open it by double-clicking the icon. The Request Filtering pane displays.
    4. From the Actions pane on the right hand side of the screen click Edit Feature Settings... link. The Edit Request Filtering Settings window displays.
    5. In the Request Limits section, enter the appropriate Maximum allowed content length (Bytes Specifying zero for this value means that the length is unlimited.) and then click the OK button.
    6. Restart IIS.

    More information about Request Filtering you can refer to this link: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh831518(v=ws.11)?redirectedfrom=MSDN#URL_Page.

    Best regards,

    Sam

    Friday, May 7, 2021 6:03 AM