FileUpload load image from /storage/... instead of /public/...
Hello,
I am using FileUpload input to store an image in a "image" directory. The problem is : FileUpload try to find the image in /storage/image/... but the image is stored in /public/image.
Thanks for your help!
Solution:Jump to solution
Sounds like your disks aren’t configured directly. Technically it should be stored in storage/images and you serve them publicly by running ‘php artisan storage:link’ this creates a symlink from public to the actual storage.
4 Replies
Solution
Sounds like your disks aren’t configured directly. Technically it should be stored in storage/images and you serve them publicly by running ‘php artisan storage:link’ this creates a symlink from public to the actual storage.
Yes that’s how Laravels filesystem works and where the file should be stored.
Thanks! But now I have a "CORS missing allow origin" :/
Edit : Ok, I changed https://www.domain.com to https://domain.com in .env file. Now it works. But I do not understand why..
You need to read up on CORS really to understand that.