title: How to update metadata using Amazon S3 SDK
body: <p>I am using the PHP version of Amazon's AWS SDK. I have a bunch of files with an <code>Expires</code> header; I want to delete that header and add a <code>Cache-control</code> header instead. The <a href="http://docs.amazonwebservices.com/AWSSDKforPHP/latest/index.html#m=AmazonS3/update_object" rel="noreferrer">update_object</a> function lets me add headers but not remove them.</p>
  
  <p>The <a href="https://stackoverflow.com/questions/269840/is-it-possible-to-change-headers-on-an-s3-object-without-downloading-the-entire">answers on this question</a> 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:</p>
  
  <pre><code>$response = $s3-&gt;copy_object(
      array(
          'bucket' =&gt; $bucket,
          'filename' =&gt; $file,
      ),
      array(
          'bucket' =&gt; $bucket,
          'filename' =&gt; $file2,
      ),
      array(
          'acl' =&gt; AmazonS3::ACL_PUBLIC,
          'headers' =&gt; array(
              'Content-Type' =&gt; 'image/jpeg',
              'Cache-Control' =&gt; 'public,max-age=30240000',
          ),
          'meta' =&gt; array(
              'x-fake-header' =&gt; 'something awesome is happening',
          ),
      )
  );
  </code></pre>
  
  <p>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.</p>
  
  <p>How do I reset the metadata?</p>