3
votes

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

3 Answers

8
votes

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.

5
votes

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.

0
votes

Use below command

gsutil defacl set public-read gs://bucketname