linux - 是否有通过 s3cmd 工具设置 cors(跨源资源共享)的选项?

标签 linux amazon-s3 cloud s3cmd

s3cmd中有没有命令http://s3tools.org/通过它我可以设置cors(跨源资源共享)

我检查了这些网站。

http://www.bucketexplorer.com/documentation/amazon-s3--manage-cross-origin-resource-sharing.html

http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html

有什么命令可以设置cors规则吗?

谢谢

最佳答案

对于您选择的工具,它看起来像 the S3cmd usage documentation有这个命令:

s3cmd setcors FILE s3://BUCKET

否则:

AWS put-bucket-cors Documentation 可能是您要找的东西?

使用

aws s3api put-bucket-cors --generate-cli-skeleton >cors.json

创建一个json输入文件,编辑后,你可以使用:

aws s3api put-bucket-cors --bucket [bucket name] --cors-configuration file://cors.json

覆盖存储桶现有的 cors 配置。

我只使用 cors.json 根 {} 中的“CORSRules”节,因为其他一切都由 cli 处理。

关于linux - 是否有通过 s3cmd 工具设置 cors(跨源资源共享)的选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31318482/

相关文章:

linux - 如何在节点应用程序的 EC2 实例中设置环境变量

linux - AWK 日期到纪元

linux - 如何删除 "dead.letter"根目录中没有可用空间的文件

python - 发生异常 : 's3.ServiceResource' object has no attribute 'head_object'

apache-spark - Spark 与 AWS S3 连接错误 : Not able to read file from S3 location through spark-shell

ruby - 想要回显新行字符

php - PHP 和 Node.js 的云计算服务

mysql - 我应该使用文件还是数据库?

haskell - Cloud Haskell 中的 ManagedProcess 如何工作?