Even though I set content type to text/html it ends up as application/octet-stream on S3.
ByteArrayInputStream contentsAsStream = new ByteArrayInputStream(c
I could fix this issue easily by commandline, I faced similar issue while uploading html files through aws commandline even though the file name had correct extension.
As mentioned in earlier comments, adding --content-type param fixes the issue.
Executing below command and refreshing page returned octet stream.
aws s3api put-object --bucket [BUCKETNAME] --body index.html --key index.html --profile [PROFILE] --acl public-read
Fix: add --content type text/html
aws s3api put-object --bucket [BUCKETNAME] --body index.html --key index.html --profile [PROFILE] --acl public-read --content-type text/html