首页 > 解决方案 > 为什么,当在 Header Content-Disposition 中指定时:附件;Filename = hello.xls 浏览器不会作为文件加载到磁盘上吗?

问题描述

为什么,当在响应标头内容处置中指定时:附件;Filename = hello.xls 浏览器是否在窗口中将数据显示为字符而不是作为文件下载到磁盘?

完整清单:

HTTP/1.1 200 
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: private, no-cache, no-store, must-revalidate
Pragma: no-cache
Liferay-Portal: Liferay Community Edition Portal 7.2.0 CE GA1 (Mueller / Build 7200 / June 4, 2019)
Content-Disposition: attachment; filename=hello.xls
Content-Type: application/octet-stream
Transfer-Encoding: chunked
Date: Thu, 19 Dec 2019 06:18:50 GMT

标签: http

解决方案


推荐阅读