locked
What maximum value is supported for maxRequestLength and maxAllowedContentLength RRS feed

  • Question

  • User264732274 posted

    please tell me maximum value is supported for maxRequestLength and maxAllowedContentLength ?

    If you are using IIS for hosting your application, then the default upload file size if 4MB. To increase it, please use this below section in your web.config

    http://weblogs.asp.net/jongalloway/large-file-uploads-in-asp-net

    <configuration>
        <system.web>
            <httpRuntime maxRequestLength="1048576" />
        </system.web>
    </configuration>

    For IIS7 and above, you also need to add the lines below:

     <system.webServer>
       <security>
          <requestFiltering>
             <requestLimits maxAllowedContentLength="1073741824" />
          </requestFiltering>
       </security>
     </system.webServer>
    Monday, February 15, 2016 6:49 PM

Answers

  • User-474980206 posted

    the real limit is how your server is configured. the absolute limit is 2gb (max size of .net object).  the max length must be less than the private memory limit of the application pool. also the number of current requests matter.  if you set the private limit to 1gb, and have four current requests, then you need at least 4gb private memory limit in the pool (the virtual size limit would be higher).

    if you go much above 100mb, then you should switch to streams and temporary store, not caching the payload in memory.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 15, 2016 8:34 PM