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?
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?
I'm afraid that this is not possible with the current API. S3 does not allow changing headers on existing files. So, you will have to upload the entire file again.
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
Actually you can copy a file within S3 storage to the same location and replace http headers. This way you don't have to re-upload the file from local computer to S3. This is how we do it in CloudBerry Explorer
the x-amz-metadata-directive header doesn't work. It results in a signature mismatch every time. All other x-amz headers work fine.