Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 用于发送PDF的HTTP标头,Firefox中存在问题_Php_Http Headers - Fatal编程技术网

Php 用于发送PDF的HTTP标头,Firefox中存在问题

Php 用于发送PDF的HTTP标头,Firefox中存在问题,php,http-headers,Php,Http Headers,在windows中,当我使用firefox adobe reader插件保存pdf时,就会出现这个问题。 保存的文件是:http://www.example.com/opendocument.php_doc=._docs_doc01 我的标题是: header('Content-type: application/pdf'); //header('Content-Disposition: inline; filename=doc01.pdf'); header("Content-Transfer

在windows中,当我使用firefox adobe reader插件保存pdf时,就会出现这个问题。 保存的文件是:
http://www.example.com/opendocument.php_doc=._docs_doc01

我的标题是:

header('Content-type: application/pdf');
//header('Content-Disposition: inline; filename=doc01.pdf');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($pdf));
最初的电话是:

http://www.example.com/opendocument.php?doc=./docs/doc01.pdf
我对附件标题不感兴趣。我必须打开进入网站,而不是下载到外部窗口


有什么想法吗?

尝试取消对
内容配置的注释:inline
标题,并对
内容类型使用正确的大写字母(即大写字母T

尝试一下,注意文件名周围的引号

Content-disposition: inline; filename="doc01.pdf"

无法保证这一点,但它取自我们的PDF生成类。

HTTP头字段名称不区分大小写。下载文件后,它是否正确打开?(也就是说,它是一个有效的PDF文件,还是在文件内容之前或之后插入了一些其他数据?)。我用了“这很好用!