Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Server : Received error code 413 when posting large data in the request

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.

like image 951
kreya Avatar asked Jul 12 '26 12:07

kreya


2 Answers

You can try below settings:

<system.web>
  <httpRuntime maxRequestLength="1048576" />
</system.web>
<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="1073741824" /> 
    </requestFiltering>
  </security>
</system.webServer>
like image 188
samwu Avatar answered Jul 15 '26 01:07

samwu


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

like image 36
RMP Avatar answered Jul 15 '26 02:07

RMP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!