是否有可能改变一个S3对象上的标题,而无需下载整个对象?对象、有可能、标题

2023-09-11 08:12:41 作者:吹糖人

我已经上传了一堆图像到Amazon S3的,现在想一个Cache-Control头添加到他们。

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? If so, how?

推荐答案

这是测试版的功能,但是当你的复制对象。指定复制的源和目的,而这刚刚更新你的对象元数据的影响。

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