【发布时间】:2013-08-08 10:56:39
【问题描述】:
不知道为什么我遇到这个问题,无法在 chrome 浏览器中下载 pdf 文件,它在 Nginx 服务器中显示以下错误。
资源解释为文档,但使用 mime 类型 application/octet-stream pdf 传输
虽然我已将 mime 类型包含为 application/pdf
【问题讨论】:
标签: google-chrome pdf nginx download mime-types
不知道为什么我遇到这个问题,无法在 chrome 浏览器中下载 pdf 文件,它在 Nginx 服务器中显示以下错误。
资源解释为文档,但使用 mime 类型 application/octet-stream pdf 传输
虽然我已将 mime 类型包含为 application/pdf
【问题讨论】:
标签: google-chrome pdf nginx download mime-types
如果这只是一个警告,那就直接忽略它!它只是 Chrome。
如果不是,请尝试将 MIME 类型包括为application/octet-stream。
【讨论】:
尝试在您的代码中使用这些示例。
这是一个经典的: 如果可以加载 localhost:8080/xyz123/PdfFile.pdf 然后这样写:
<iframe src="./xyz123/PdfFile.pdf" title="title">
<a href="./xyz123/PdfFile.pdf"> ... </a>
</iframe>
【讨论】:
我只对.pdf 文件提出了类似的问题。我将应用程序池的身份更改为Network Service,它解决了这个问题。
我不确定为什么它会起作用,因为响应标头仍然具有相同的 Content-Type,但它起作用了。
【讨论】: