Mohammad Ghanem
Mohammad Ghanem

Reputation: 726

413 Request Entity Too Large - File Upload ASP.NET MVC

Trying to upload large files around 500 MB using asp.net mvc.

My web.config looks like below but I'm still getting the error on production server but its working on my local IIS (not IIS Express) :

 <httpRuntime targetFramework="4.5" maxRequestLength="1048576" />

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

          </requestFiltering>
      </security>
  </system.webServer>

Upvotes: 1

Views: 2041

Answers (1)

Ding Peng
Ding Peng

Reputation: 3964

Solution:

The quickest solution is to increase the upload size limit. IIS uses uploadReadAheadSize parameter in applicationHost.config and web.config files to control this limit.

Steps to change the value of this parameter:

  1. Open IIS Manager

  2. Select the site

  3. Double click "Configuration Editor"

  4. Select system.webServer and then serverRuntime

  5. Modify the uploadReadAheadSize value

  6. Click "Apply"

enter image description here

Upvotes: 1

Related Questions