Default Limits <limits> for IIS Express

You basically need to set both in web.config maxRequestLength and maxAllowedContentLength to upload files.

  • maxRequestLength Indicates the maximum file upload size supported by ASP.NET
  • maxAllowedContentLength This specifies the maximum length of content in a request supported by IIS.

Note:maxRequestLength is in kilobytes & maxAllowedContentLength is in Bytes

By default, Machine.config is configured to accept HTTP Requests upto 4096 KB (4 MB) and it is reflected in all your ASP.NET applications. You can change the Machine.config file directly, or you can change only the Web.config file of the application(s) you want to

<system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="524288000"/>
            </requestFiltering>
        </security>
</system.webServer>

 <system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="1073741824" />
      </requestFiltering>
   </security>
 </system.webServer>

You can use this in web.config

<system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="524288000"/>
            </requestFiltering>
        </security>
</system.webServer>

As others mentioned already you need to modify applicationhost.config and put into it

<security>
    <requestFiltering>
        <requestLimits maxAllowedContentLength="524288000"/>
    </requestFiltering>
</security>

What other people didn't mention is that when you are running your web app from Visual Studio, the location of applicationhost.config in the root directory of your project is
.vs\{your_project_name}\config\applicationhost.config and this is the file you will need to modify


If the web.config change ppascualv suggested doesn't work, try putting it in the IIS Express applicationhost.config, which can be found at

%userprofile%\my documents\iisexpress\config\applicationhost.config

under

<system.webServer>

put

<security>
    <requestFiltering>
        <requestLimits maxAllowedContentLength="524288000"/>
    </requestFiltering>
</security>

This should set it as a global, unless a web.config from an application overrides it.