title: How to set metadata in S3 using boto?
body: <p>I am trying to set metadata during pushing a file to S3.</p>
  
  <p>This is how it looks like :</p>
  
  <pre><code>def pushFileToBucket(fileName, bucket, key_name, metadata):
      full_key_name = os.path.join(fileName, key_name)
      k = bucket.new_key(full_key_name)
      k.set_metadata('my_key', 'value')
      k.set_contents_from_filename(fileName)
  </code></pre>
  
  <p>For some reason this throws error at set_metadata saying :</p>
  
  <pre><code>boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;Error&gt;&lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;&lt;/Error&gt;
  </code></pre>
  
  <p>And when I remove this <code>set_metadata</code> part, the file is getting stored correctly.
  Not sure what I am doing wrong. If the access key was invalid, then it wouldn't have saved the file anyway!</p>