I'm trying to download from a VueJS front-end an image that is stored into my S3 bucket but I always receive a cors error. I've tried several Cors Configuration for my bucket such as:
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://******.s3-website-us-east-1.amazonaws.com/#/</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
I've tried with to change the origin for * and its not working. I'm always receiving
OPTIONS https://elasticbeanstalk-us-east-1-*********.s3.amazonaws.com/da2f83b3-3563-2d3a-b421-7ce3832f7132.png net::ERR_ABORTED 403 (Forbidden)
Access to XMLHttpRequest at 'https://elasticbeanstalk-us-east-1-*********.s3.amazonaws.com/da2f83b3-3563-2d3a-b421-7ce3832f7132.png' from origin 'http://********.s3-website-us-east-1.amazonaws.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Here is my call on front-end:
savePicture() {
axios({
url: "https://*****.s3.amazonaws.com/da2f83b3-3563-2d3a-b421-7ce3832f7132.png",
method: 'GET',
responseType: 'blob',
})
I've double checked my config with the AWS documentation, so I'm not sure what is wrong.