1

I hosted WebAPI on the IIS which is written in laravel. I have one request size of 60 MB. I am trying to send this data to the server but receiving 413 errors - "Request Entity Too Large".

enter image description here

I updated php.ini and set the below value

  • max_execution_time = 6000
  • upload_max_filesize = 1512M
  • max_input_vars = 5000
  • post_max_size = 1024M

I also updated uploadReadAheadSize of the IIS Server and set "80485760"

enter image description here

Edit

After updating php.ini and server config, I restarted the server.

kreya
  • 1,091
  • 5
  • 24
  • 52

3 Answers3

4

You can try below settings:

<system.web>
  <httpRuntime maxRequestLength="1048576" />
</system.web>
<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="1073741824" /> 
    </requestFiltering>
  </security>
</system.webServer>
samwu
  • 3,857
  • 3
  • 11
  • 25
2

IIS has a limit for the size of the files users can upload to an application. If the file size exceeds the limit, the application will throw “Error in HTTP request, received HTTP status 413 (Request Entity Too Large)” error.

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”

Reference: https://techcommunity.microsoft.com/t5/iis-support-blog/solution-for-request-entity-too-large-error/ba-p/501134

RMP
  • 46
  • 3
  • Welcome to SO! Please don't post link-only answers but summarize the linked content or its relevant parts a little. A link may become invalid or outdated and in that case, your answer would be useless in the future. – ahuemmer Aug 29 '22 at 06:15
-2

You can try to compress the file before uploading or split the data into some smaller parts then try sending the request.