Upload public object to Google Cloud Storage with public link

本秂侑毒 提交于 2019-12-05 18:23:47

The web interface doesn't provide a way to make the objects being uploaded public automatically, but you can do one of two things:

  1. If you want to just make objects publicly readable during one particular session you could use gsutil to do it, e.g.,

    gsutil -m cp -a public-read dir/* gs://your-bucket

  2. If you want to make objects publicly readable across all future sessions you could set a default object ACL on the bucket, using a command like:

    gsutil defacl set public-read gs://your-bucket

If you do that, uploads via the web interface (as well as by any other API requests, e.g., gsutil cp commands) will be made publicly readable automatically.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!