Search code examples
asp.net-mvcmaxrequestlength

how many request can be handled by Request.Files mvc asp.net?


When I uploaded about 18 files at a time the browser showed following error:

Maximum request length exceeded.

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: Maximum request length exceeded.

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.


Solution

  • Maximum request length can be set in web.config . The default size is 4 mb.

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

    Check this post for more details.