Reputation: 5323
I have a bucket with many subdirectories containing a variety of different files. How can I make only my images accessible publicly? The following is great for making everything public but I don't seem to be able to filter on extension.
$ gsutil -m acl set -R -a public-read gs://mybucket
Upvotes: 0
Views: 365
Reputation: 5509
I'd recommend using gsutil acl ch
, which will preserve all existing ACLs on your objects and make them publicly readable. This command should do the trick:
gsutil -m acl ch -u AllUsers:R gs://mybucket/**/*.png gs://mybucket/**/*.jpg
Using the canned acl (i.e., acl set -a public-read
) can remove other ACL changes that you've made.
Upvotes: 2