I have 1000 files in Google Cloud Storage to make public, or in general a directory hierarchy.
In the Web UI, I can only seem to make one at a time public.
Is there some way to do this.
Every Google Account comes with 15 GB of storage that's shared across Google Drive, Gmail, and Google Photos. When you upgrade to Google One, your total storage increases to 100 GB or more depending on what plan you choose.
Note: Accessing public data via the Google Cloud console requires you to sign in with a Google account. The method described in the API link tab provides the most broadly applicable way to access individual public objects. Get the name of the public object and the bucket that stores the object.
Run gsutil -m acl set -R -a public-read gs://bucket
-m
issues multiple requests at the same time.-R
issues requests for every object in your bucket.-a
issues requests for every version of every object.See gsutil help acl
for more info.
At the API layer gsutil issues the following HTTP request:
PUT /bucket/obj?acl HTTP/1.1
Host: storage.googleapis.com
x-goog-acl: public-read
You can see this by using the -D
flag with gsutil
:
gsutil -D setacl public-read gs://bucket/obj
You can make all objects in a bucket public. Here's the link.
- Open the Cloud Storage browser in the Google Cloud Platform Console.
- In the list of buckets, click on the name of the bucket that you want to make public.
- Select the Permissions tab near the top of the page.
- Click the Add members button.
The Add members dialog box appears.- In the Members field, enter allUsers.
- In the Roles drop down, select the Storage sub-menu, and click the Storage Object Viewer option.
- Click Add.
Once shared publicly, a link icon appears for each object in the public access >column. You can click on this icon to get the URL for the object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With