有没有通过s3cmd工具设置cors(Cross Origin Resouce Sharing)的选项?

时间:2015-07-09 13:09:20

标签: linux amazon-s3 cloud s3cmd

s3cmd http://s3tools.org/中是否有任何可以设置cors的命令(Cross Origin Resouce Sharing)

我检查了这些网站。

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

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

我可以通过哪些命令设置cors规则吗?

由于

1 个答案:

答案 0 :(得分:1)

对于您选择的工具,看起来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配置。

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