内联PDF附件 - 不适用于FF

时间:2017-06-13 20:22:37

标签: php inline attachment

我的php脚本输出以下代码:

<object height="100%" width="100%" id="help" align="left" data="file_helper.php" type="application/pdf">
    Click <a href="file_helper.php">here</a> to view help.
</object>

不带参数的file_helper.php的定义如下:

header('Content-type: application/pdf');
header('Content-Disposition: inline');
header('Content-Transfer-Encoding: binary');
header('Pragma: no-cache');
header('Content-Length: '.<length of binary pdf file>);
header('Expires: 0');
echo '<binary pdf file>'

问题是这适用于Internet Explorer,Chrome。 在Firefox中,它只能在本地使用,但不能在远程端使用。

在Firefox上我改为:点击此处查看帮助,并使用href。

但我想显示文件内联。我做错了吗?

编辑:Android Chrome,Android FF不显示pdf;在Ubuntu上显示FF,Windows上的FF不显示。

0 个答案:

没有答案
相关问题