I want to set Content-Type
metadata to image/jpeg
for all objects of a Google Storage bucket.
How to do this?
I want to set Content-Type
metadata to image/jpeg
for all objects of a Google Storage bucket.
How to do this?
Using gsutil
and its setmeta
command:
gsutil -m setmeta -h "Content-Type:image/jpeg" gs://YOUR_BUCKET/**/*.jpg
Use the -m
to activate a parallel update, in case you have a lot of objects.
The /**/*
pattern will perform a recursive search on any folders that you may have on your bucket.
© 2022 - 2024 — McMap. All rights reserved.
picture/in/some/folder.jpg
, then you should use a recursive glob pattern:gs://YOUR_BUCKET/**/*.jpg
– Calbert