S3 CORS
when trying to upload to s3 bucket got this error in my console:
"Access to fetch at 'https://kno-buckets.s3.amazonaws.com/profile-photos/51/Kavitha-Rajendran-Mudaliar.jpg' from origin 'https://sms.test' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."
though the image is uploaded on the s3 bucket but can't be retrieved.
7 Replies
CORS configuration - Amazon Simple Storage Service
Create an XML or JSON CORS configuration on your bucket.
i have it configured already
You sure it’s configured correctly ? I’m new to s3 etc but I had trouble until I had it correct
yes, this is my cors policy:
on my view page if i inspect the element with broken image i can see the correct image url from S3
Solution
Do you have visibility set to private on the File component?
no
setting visibility to private worked
thanks
worked on my Mac but on windows returning 404 in the console and network tab
fixed
needed to include the region in the
AWS_URL