Jun 14, 2022
0
Level 1
Sail | add header Access-Control-Allow-Origin: "*" to uploaded files
Hi,
I'm using sail in local developement which uses artisan serve, I upload images to path /public/uploads/ using local filesystem driver, in my vue frontend, i use https://lokeshdhakar.com/projects/color-thief/ to get the color palette from uploaded images, but i got into Cors problem, in order to solve it i have to add header Access-Control-Allow-Origin: "*" to the images being accessed like http://127.0.0.1:9091/uploads/projects/GSryr6uQsSVMzTbFwd1yo884gIDM2ROEWAXpHpnK.jpg.
how i can add this header to the uploaded files, i want only to add the header to those files, not the application rotes
Please or to participate in this conversation.