Content Type when serving a file in a generic handler

后端 未结 1 1411
遇见更好的自我
遇见更好的自我 2021-01-11 12:16

I\'m busy writing a handler to serve various documents for download or presentation in web forms pages. The documents range from various image formats, to PDF, to MS Office

相关标签:
1条回答
  • 2021-01-11 13:04

    application/octet-stream is fine for file downloading, but if you want the browser to interact with the file, you might want to change the content type.

    For example, the mime-type for downloading a PDF file is application/octet-stream, while application/pdf will tell the browser to open the file in the browser itself.

    http://en.wikipedia.org/wiki/Internet_media_type

    0 讨论(0)
提交回复
热议问题