http - 为什么,当在 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
解决方案
推荐阅读
- javascript - 如何使用javascript在与文本相同的行中添加按钮?
- java - 编写多线程的最佳方法
- sql - 如何查找输入值不合适的记录
- tensorflow - 张量流 sigmoid 函数不起作用
- pip - 无法 PIP 安装 Python ftfy 包
- php - 从 php curl 调用渲染 .NET 视图
- android - 如何在屏幕中心的所有小部件顶部显示 CircularProgressIndicator
- django - Django 无法访问 Azure 挂载的存储
- elasticsearch - Elasticseach - 范围聚合,只计算每种产品的最高价格
- docker - 无法在浏览器中访问正在运行的 Docker 容器