google-cloud-storage - 将 "public"目录上传到 Google Cloud Storage

标签 google-cloud-storage gsutil

使用 SSH 中的此命令,我可以将整个文件夹上传到 Google Cloud Storage:

gsutil cp -R folder_big gs://bucket_name

这些是文件夹内的文件:

enter image description here

我不想单独单击每个文件以将其公开。

如何在上传时自动公开文件夹(以及其中的所有文件)?

最佳答案

你可以这样做:

gsutil cp -a public-read -R folder_big gs://bucket_name

注意:如果它是一个大文件夹,如果您使用多线程选项,您可能会获得显着的性能改进:
gsutil -m cp -a public-read -R folder_big gs://bucket_name

关于google-cloud-storage - 将 "public"目录上传到 Google Cloud Storage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31010405/

相关文章:

python - 谷歌云应用引擎 : Python2 or Python3? 的最佳实践

google-cloud-platform - "Service account authorization without OAuth",我们可以通过这种方法从谷歌云存储中获取文件吗?

google-cloud-storage - gsutil 上的 ResumableUploadAbortException

docker - Gsutil 在 Google Compute Engine 上的 Dockerfile 中不起作用

java - Google Cloud Storage - Java API 中是否有等效的 gsutil 'rsync'?

python - 无法在 ML Engine 中导入 Google Cloud Storage 库

sql - BigQuery 检查表是否存在

node.js - 使用 Cloud Functions for Firebase 和 @google-cloud/storage 删除图像时出现问题

google-cloud-storage - 返回文件的限制

python - 使用 Python 从 Google Cloud Storage 下载大文件