这是我的问题。我正在尝试调用一个页面:foo.php?docID = bar并将PDF返回到作为BLOB存储在数据库中的屏幕。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。
由于提前,
〜扎克
我想通了这个问题。看到我的解释如下 – 2009-04-21 18:55:33