3
votes

I am trying to upload large images to server (binary file upload) via postman, it works fine for files sized 2 MB and below, however for files > 2 MB the upload fails

I set php.ini

upload_max_filesize = 100M post_max_size = 100M

and

nginx /etc/nginx/nginx.conf

client_body_buffer_size 100M; client_max_body_size 100M;

but it doesn't work

I tried plupload package for chunk upload but it also doesn't work for files > 2 MB

Any ideas how to upload large images in laravel ?

2
did you restart the server after you made the changes? does the phpinfo() function show the updated values which you did change?rsz
Thanks your help, i changed the wrong php.ini file. instead of the /etc/php5/fpm/php.ini i changed the /etc/php5/cli/php.ini, now the upload works fineAhmed Gamal

2 Answers

4
votes

It's doen't work because you set the wrong php.ini file do this on laravel dd(phpinfo()) and look the right php.ini use by laravel in the value

Loaded Configuration File

2
votes

may be I am a bit late for you , but for sake of everyone else , you may consider using this package

Resumablejs

it split file into chunks and upload each one, and if one failed , it will retry until all parts is completely uploaded.