Allowing publicly shared files on google cloud sto

2019-03-31 14:35发布

Google cloud storage allows users to check a "publicly shared?" field in the storage manager that allows you to share a URL to the data directly.

I'm using google app engine and sending data to the storage, but I would like to have it publicly shared by default.

How can I do this? Their docs does not seem to mention anything about this, except manually doing it.

I am using python but it probably doesn't make much of a difference.

3条回答
唯我独甜
2楼-- · 2019-03-31 15:16

You can set the ACL on individual files that your write to Google Storage to the values described here.

Something like

my_file = files.gs.create('/gs/some_bucket/some_object', acl='public-read')

Then you can configure the ACL on each object in the bucket individually rather than having a blanket ACL.

查看更多
Animai°情兽
3楼-- · 2019-03-31 15:22

You can use the GSUtil tool and set and Default ACL on the bucket.
In the default ACL allow everyone to allow READ on the bucket, after setting the default ACL every new file in the bucket will be publicly available.

查看更多
祖国的老花朵
4楼-- · 2019-03-31 15:23

Use below command

gsutil defacl set public-read gs://bucketname
查看更多
登录 后发表回答