0
votes

I have a problem with saving files (photos) with laravel in a web hosting. I can do it in localhost and works perfectly. But now I migrate all project to a web hosting, but saving files is not working.

The form is working, the name of file it's saved, but the file not.

I have this code into my config/filesystems.php:

'local' => [
     'driver' => 'local',
     'root'   => public_path('web/photos'),
],

And I have this folders in public_html/web/photos Whats is wrong?

1
Likely a permissions issue. Try a dd(is_writable(public_path('web/photos'))) somewhere in your code to check.jszobody
Or log it. Wouldn't recommend dd'ing on live.Doom5

1 Answers

0
votes

It's all about file permissions, on your web webserver you need to change it.

If you have console access:

sudo chown www-data /public_html/web/photos
sudo chmod 755 /public_html/web/photos

Or by FTP-client like so: https://www.youtube.com/watch?v=GWBwqlUhQOM