Reputation: 946
I found one public bucket on the web, which contains some files, which everybody can view or download. I want to create the same thing, where I can upload similar files.
Here is how the permissions of this public bucket look like:
Unfortunately I cannot create the same thing, searched the whole web, but haven't found any step by step explanation.
Could anybody help me with this ?
Upvotes: 1
Views: 828
Reputation: 38369
From the gsutil command line (which is preinstalled on the cloud shell), you can set this up with these commands:
gsutil acl ch -g allUsers:R gs://bucketname
gsutil acl ch -g allUsers:R gs://bucketname/**
gsutil defacl ch -g allUsers:R gs://bucketname
Finally, standard warning about public buckets: anyone is allowed to download resources from this bucket, and the bill will go to the bucket owner, who is you. This could end up being expensive for you if, for instance, you upload a popular video and 10 million people download it. If you want to make an object publicly accessible but want the downloaders to pay for it, you may prefer to use a feature like Requester Pays: https://cloud.google.com/storage/docs/requester-pays
Upvotes: 0
Reputation: 8056
According to the oficial documentation Making Data Public
Open the Cloud Storage browser in the Google Cloud Platform Console.
In the list of buckets, click on the name of the bucket that contains the object you want to make public, and navigate to the object if it's in a subdirectory.
Click the drop-down menu associated with the object that you want to make public.
The drop-down menu appears as three vertical dots to the far right of the object's row.
Select Edit permissions from the drop-down menu.
In the overlay that appears, click the + Add item button.
Add a permission for allUsers.
Select User for the Entity. Enter allUsers for the Name. Select Reader for the Access.
- Click Save.
Upvotes: 2