danimohamadnejad's avatar

Laravel, large files cannot be uploaded

I am trying to upload a file as large as 20 MB. Controller validator returns "File failed to upload" error!! does anybody have any solution? I have also set upload_max_filesize and post_max_size but none seems to work.

0 likes
12 replies
Sinnbeck's avatar

make a file called phpinfo.php with this content

<?php
phpinfo(); 

Call it in the browser and see if the values are set there as well. If not restart the webserver.

1 like
Sinnbeck's avatar

@danimohamadnejad Are you sure you changed the right ones? There are seperate ini files for cli (commandline), fpm etc.

1 like
danimohamadnejad's avatar

@Sinnbeck I have used php -i command on terminal and it returns /etc/php/7.4/cli/php.ini. So I changed it and also used ini_set manualy in php code. I don't know where else to manipulate.

1 like

Please or to participate in this conversation.