files served with content-disposition: inline still sometimes prompt for download

后端 未结 2 715
灰色年华
灰色年华 2021-01-19 03:17

My subject line says most of what I\'m asking. I\'ve got a web site that outputs reports in various formats (HTML, CSV, TSV, Excel, etc). Whenever possible, I\'d like thes

2条回答
  •  春和景丽
    2021-01-19 03:37

    You may have resolved this already, but if not I may have an answer (for future people with the same issue, this also drove me nuts!)

    This behavior can be overwritten on the client, using the following:

    1. Go to windows explorer
    2. Select Tools -> Folder Options
    3. Select “File Types” Tab
    4. Find extension “DOC” (or “PDF”, etc)
    5. Select “Advanced”
    6. Tick / Untick “Confirm open after download” as desired.

    The mechanism used to implement the preview / download functionality is via the use of the “content-disposition” header, usually using MimeType “application/”. This basically tells the local client to open the application using the specified application, however the above settings for the application can overwrite the requested delivery format.

提交回复
热议问题