我在 Google Cloud Storage 中有 1000 个要公开的文件,或者一般来说是一个目录层次结构。
在 Web UI 中,我似乎一次只能公开一个。
有什么办法可以做到这一点吗?
最佳答案
运行gsutil -m acl set -R -a public-read gs://bucket
-m
同时发出多个请求。-R
向存储桶中的每个对象发出请求。-a
为每个对象的每个版本发出请求。
参见gsutil help acl
了解更多信息。
API层gsutil发出以下 HTTP 请求:
PUT /bucket/obj?acl HTTP/1.1
Host: storage.googleapis.com
x-goog-acl: public-read
您可以通过将 -D
标志与 gsutil
结合使用来查看这一点:
gsutil -D setacl public-read gs://bucket/obj
关于google-cloud-platform - 如何在 Google Cloud Storage 中公开多个文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14371376/