OchiengD's avatar

Payload Too Large(Laravel and VueJs)

I am bulding a project using Vuejs and Laravel api... I am trying to send an axios post request to store the contents of a form but i get 413 error(Payload Too large). The form contains 4 file upload inputs plus other inputs. I have tried adjusting the max_upload configuration of both php and apache but it still does not work

0 likes
1 reply
Cronix's avatar

max_upload only deals with the size of the uploaded files, not the entire POST object (all form fields PLUS files). In addition, there are also timing issues. You'll want to increase the time php will stay awake to process the request.

upload_max_filesize
post_max_size
max_input_time
max_execution_time

The larger the files, the longer the input_time and execution_time need to be to allow the file to be uploaded, and any sort of processing you are doing on the php end. If it takes 10 minutes to upload a file, the input_time/execution_time need to be at least that long (php default is usually only 30 seconds).

That only deals with the php end though. You will probably also have to adjust relevant settings for apache/nginx or whatever you're using for a webserver. Those settings should be slightly larger than the corresponding php settings.

Please or to participate in this conversation.