How to solve S3 CORS file error with "Access-Control-Allow-Origin" header block

Published: 04 September 2020
on channel: Jonathan Soma
90,513
507

Did you upload a file to S3 to power your web application or visualization, and now it just won’t work? Let’s figure out what CORS is and how it prevents you from accessing a file that seems to work normally locally and when visiting the URL manually.

AWS DOESN'T ACCEPT XML ANY MORE! You'll get the error "The CORS configuration must be written in valid JSON." The new JSON CORS policy code is located at https://gist.github.com/jsoma/5830e8b...

The old XML CORS policy code is located at https://gist.github.com/jsoma/ed9eb3d...

The error you were probably getting is: Access to fetch at 'https://xxxxxx.s3.amazonaws.com/' from origin 'http://localhost:8000' 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.

References: https://aws.amazon.com/


Watch video How to solve S3 CORS file error with "Access-Control-Allow-Origin" header block online without registration, duration hours minute second in high quality. This video was added by user Jonathan Soma 04 September 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 90,513 once and liked it 507 people.