title: How do I upload a gzip object to s3?
body: <p>I am creating a gzip string and uploading it as an object to s3. However when I download the same file from s3 and decompress it locally with gunzip I get this error: <code>gunzip: 111.gz: not in gzip format</code> When I look at the mime_content_type returned in the file downloaded from s3 it is set as: <code>application/zlib</code></p>
  
  <p>Here is the code I am running to generate the gzip file and push it to s3:</p>
  
  <pre><code>for($i=0;$i&lt;=100;$i++) {
      $content .= $i . "\n";
  }
  
  $result = $this-&gt;s3-&gt;putObject(array(
     'Bucket' =&gt; 'my-bucket-name',
     'Key'    =&gt; '111.gz',
     'Body'   =&gt; gzcompress($content),
     'ACL' =&gt; 'authenticated-read',
     'Metadata' =&gt; [
         'ContentType' =&gt; 'text/plain',
         'ContentEncoding' =&gt; 'gzip'
     ]
  ));
  </code></pre>
  
  <p>The strange thing is that if I view the gzip content locally before I send it to s3 I am able to decompress it and see the original string. So I must be uploading the file incorrectly, any thoughts? </p>