Set metadata for all objects in a Google Storage bucket

跟風遠走 提交于 2020-03-01 06:32:07

问题


I want to set Content-Type metadata to image/jpeg for all objects of a Google Storage bucket.

How to do this?


回答1:


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.



来源:https://stackoverflow.com/questions/52691451/set-metadata-for-all-objects-in-a-google-storage-bucket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!