F
Filament3mo ago
bouly

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:
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.
Jump to solution
4 Replies
Solution
awcodes
awcodes3mo ago
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.
Dennis Koch
Dennis Koch3mo ago
Yes that’s how Laravels filesystem works and where the file should be stored.
bouly
bouly3mo ago
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..
toeknee
toeknee3mo ago
You need to read up on CORS really to understand that.