Why does file uploaded to S3 have content type application/octet-stream unless i name the file .html

前端 未结 5 566
悲哀的现实
悲哀的现实 2021-01-17 09:04

Even though I set content type to text/html it ends up as application/octet-stream on S3.

ByteArrayInputStream contentsAsStream = new ByteArrayInputStream(c         


        
5条回答
  •  广开言路
    2021-01-17 09:21

    Do you have any Override on the default mime content on your S3 account? Look at this link to see how to check it: How to override default Content Types.

    Anyway, it looks like your S3 client fails to determine the correct mime-type by the content of the file, so it relies on the extension. octet-stream is the widely used default content mime type when a browser/servlet can't determine the mimetype: Is there any default mime type?

提交回复
热议问题