I am using the PHP version of Amazon's AWS SDK. I have a bunch of files with an Expires
header; I want to delete that header and add a Cache-control
header instead. The update_object function lets me add headers but not remove them.
The answers on this question suggest you can update a file's metadata when you copy it, but I have tried it and it doesn't work. Here is what I used:
$response = $s3->copy_object(
array(
'bucket' => $bucket,
'filename' => $file,
),
array(
'bucket' => $bucket,
'filename' => $file2,
),
array(
'acl' => AmazonS3::ACL_PUBLIC,
'headers' => array(
'Content-Type' => 'image/jpeg',
'Cache-Control' => 'public,max-age=30240000',
),
'meta' => array(
'x-fake-header' => 'something awesome is happening',
),
)
);
However, the copied object has the exact same headers as the original object (Expires and Content-Type only). I've tried all manner of combinations of the above (with and without Content-Type, Cache-control, meta, etc) and get the same result.
How do I reset the metadata?