title: How can I change the content-type of an object using AWS CLI?
body: <p>I've got several objects stored in Amazon S3 whose content-type I need to change from <code>text/html</code> to <code>application/rss+xml</code>. I gather that it should be possible to do this with a copy command, specifying the same path for the source and destination. I'm trying to do this using the AWS cli tools, but I'm getting this error:</p>
  
  <pre><code>$ aws s3 cp s3://mybucket/feed/ogg/index.html \
              s3://mybucket/feed/ogg/index.html \
              --content-type 'application/rss+xml'
  copy failed: s3://mybucket/feed/ogg/index.html
  to s3://mybucket/feed/ogg/index.html
  A client error (InvalidRequest) occurred when calling the
  CopyObject operation: This copy request is illegal because it is
  trying to copy an object to itself without changing the object's
  metadata, storage class, website redirect location or encryption
  attributes.
  </code></pre>
  
  <p>If I specify a different path for source and destination, I don't get the error:</p>
  
  <pre><code>$ aws s3 cp s3://mybucket/feed/ogg/index.html \
              s3://mybucket/feed/ogg/index2.html \
              --content-type 'application/rss+xml'
  copy: s3://mybucket/feed/ogg/index.html
  to s3://mybucket/feed/ogg/index2.html
  </code></pre>
  
  <p>Even though the command completes successfully, the <code>index2.html</code> object is created with the <code>text/html</code> content type, not the <code>application/rss+xml</code> type that I specified.</p>
  
  <p>How can I modify this command-line to make it work?</p>