[英]AWS S3 bucket folder files and sub folder give public permission using php
I want to give the public permission to recursive to all the files of folder using AWS SDK.我想授予公众使用 AWS SDK 递归到文件夹的所有文件的权限。
for example例如
Bucket name: media folder: images/2020-04存储桶名称:媒体文件夹:images/2020-04
I want to make 2020-04 make public.我想让 2020-04 公之于众。 such we give using
这样我们给使用
sudo chmod -R 0777 images/2020-04
You can use this policy to only grant access to images/2020-04
您可以使用此策略仅授予对
images/2020-04
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"S1",
"Effect":"Allow",
"Principal": "*",
"Action": "s3:*",
"Resource":["arn:aws:s3:::your-bucket-name/images/2020-04/*"]
}
]
}
You need to attach this policy to the bucket.您需要将此策略附加到存储桶。
Note: replace your-bucket-name with your bucket's name.注意:将your-bucket-name替换为您的存储桶名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.