title: Why does file uploaded to S3 have content type application/octet-stream unless I name the file .html?
body: <p>Even though I set content type to text/html it ends up as application/octet-stream on S3.</p>
  <pre><code>ByteArrayInputStream contentsAsStream = new ByteArrayInputStream(contentAsBytes);
  ObjectMetadata md = new ObjectMetadata();
  md.setContentLength(contentAsBytes.length);
  md.setContentType(&quot;text/html&quot;);
  s3.putObject(new PutObjectRequest(ARTIST_BUCKET_NAME, artistId, contentsAsStream, md));
             
  </code></pre>
  <p>If however I name the file so that it ends up with .html</p>
  <pre><code>s3.putObject(new PutObjectRequest(ARTIST_BUCKET_NAME, artistId + &quot;.html&quot;, contentsAsStream, md));
  </code></pre>
  <p>then it works.</p>
  <p>Is my md object just being ignored? How can I get round this programmatically as over time I need to upload thousands of files so cannot just go into S3 UI and manually fix the contentType.</p>