过去几天我在线阅读了几十个这个问题的答案,所以我猜测答案非常具体。我有一个从Rails开发应用程序上传的存储桶,并且像这样设置了cors(用于localhost):
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
我有一个像这样设置的存储桶策略:
{
"Version": "2012-10-17",
"Id": ID,
"Statement": [
{
"Sid": SID,
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject",
"s3:GetObjectAcl",
"s3:PutObject",
"s3:PutObjectAcl"
],
"Resource": "arn:aws:s3:::BUCKET_NAME/*"
}
]
}
]
我正在使用带有s3_direct_upload gem的dropzone,这一切似乎都运行正常。我已经仔细检查了密钥,密钥,存储桶名称和区域。除了桶策略之外,我还需要IAM策略吗?