Is it possible to change headers on an S3 object without downloading the entire object?

后端 未结 6 1827
悲哀的现实
悲哀的现实 2020-12-08 09:59

I\'ve uploaded a bunch of images to Amazon S3, and now want to add a Cache-Control header to them.

Can the header be updated without downloading the entire image? I

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 10:24

    It's beta functionality, but you can specify new meta data when you copy an object. Specify the same source and destination for the copy, and this has the effect of just updating the meta data on your object.

    PUT /myObject HTTP/1.1
    Host: mybucket.s3.amazonaws.com  
    x-amz-copy-source: /mybucket/myObject  
    x-amz-metadata-directive: REPLACE  
    x-amz-meta-myKey: newValue
    

提交回复
热议问题