2 回答
- 最新
- 投票最多
- 评论最多
1
Hi,
CORS allows the client browser to check with the third-party servers if the request is authorized before any data transfer. By default, browsers enforce that clients can only send requests to a resource with the same origin as the client's URL. Take a look at the following AWS page for more information.
Since your web application running in localhost
domain is trying to interact with resources in s3.us-east-1.amazonaws.com
, you need to configure CORS response headers on the S3 bucket (Access-Control-Allow-Methods
, Access-Control-Allow-Headers
and Access-Control-Allow-Origin
), so that your application can consume it.
Below I attach some AWS pages that describes how to configure it step by step.
相关内容
- AWS 官方已更新 5 个月前
- AWS 官方已更新 4 个月前
- AWS 官方已更新 1 年前
As You can see this is the function that I wrote to create a bucket dynamically. When I am trying to do this I am getting CORS error. For the buckets that already existed in my S3 service I have set CORS policy to allow requests and thats working fine I am getting Objects inside of those Buckets. But How to create a bucket dynamically in angular without any CORS errors ?
Hi,
According to following GitHub and StackOverflow issues, it is not possible to create a bucket from the browser using the AWS-SDK, since the S3 Service team still doesn't add CORS support for
CreateBucket
operation.