脚本宝典收集整理的这篇文章主要介绍了IE(HTTPS):从php文件生成pdf不起作用,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的代码实际返回PDF的部分:
$docID = isset($_REQUEST['docID']) ? $_REQUEST['docID'] : null; if ($docID == null){ die("Document ID was not given."); } $results = getDocumentResults($docID); if (verifyUser($user,$results['PRoductId'])){ header('Content-tyPE: application/pdf'); // this is the BLOB data From the results. print $results[1]; } else{ die('You are not Allowed to view this document.'); }
这在Firefox中工作得很好.
但是,在IE中,它根本不显示任何东西.如果我在另一个网页(即GOOGLE.COM)上,并输入网址即可进入此页面,它会说明已经完成,但我仍然会在我的屏幕上显示google.com.
我检查了来自firefox和IE的响应的标题.他们是一样的
有没有人有什么建议?需要更多信息?
HTTP/1.1 200 OK Cache-Control: no-Store,no-cache,must-revalidate,post-check=0,pre-check=0 Pragma: no-cache Content-Length: 349930 Content-Type: application/pdf Expires: Thu,19 Nov 1981 08:52:00 GMT Server: Microsoft-iIS/6.0 X-Powered-By: PHP/5.1.2 Set-Cookie: PHPSESSID=cql3n3oc13crv3r46h2q04dvq4; path=/; domain=.example.com Content-DisposITion: inline; filename='downloadedFile.pdf' X-Powered-By: ASP.NET Date: Tue,21 Apr 2009 16:35:59 GMT %PDF-1.4
编辑:此外,拉出pdf文件的页面实际上使用HTTPS而不是HTTP.
提前致谢,
〜扎克
这是一个缓存问题.当我设置:
header("Cache-Control: max-age=1"); header("Pragma: public");
(见here),这个PDF缓存足够长,足以让adobe reader加载项抓住它.
以上是脚本宝典为你收集整理的IE(HTTPS):从php文件生成pdf不起作用全部内容,希望文章能够帮你解决IE(HTTPS):从php文件生成pdf不起作用所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。