0

I am trying to upload a file from an application to S3.

and i am getting the below error

Access to XMLHttpRequest at 'https://yellow-pages-bahrain.s3.amazonaws.com/Chrysanthemum?AWSAccessKeyId=******************&Content-Type=jpg&Expires=1595840227&Signature=knHfUhZ7kqvWLAQlfsbCpzY96as%3D' from origin 'http://localhost:3003' 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.

I have configured the CROS policy as

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>HEAD</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

Am i missing anything. What else needs to be added to this?

sumanth shetty
  • 1,851
  • 5
  • 24
  • 57
  • Does this answer your question? [Amazon s3 Javascript- No 'Access-Control-Allow-Origin' header is present on the requested resource](https://stackoverflow.com/questions/28568794/amazon-s3-javascript-no-access-control-allow-origin-header-is-present-on-the) – Sangam Belose Jul 27 '20 at 10:01
  • @SangamBelose sorry to get back to you this late. But i have implemented all the things which are suggested in the thread. – sumanth shetty Aug 18 '20 at 04:52

0 Answers0