我使用mpdf在PHP中生成pdf报告,当我使用XAMPP在我正在开发的PC上测试时,pdf报告显示在浏览器中,但是当我将它托管到when服务器时,它不会在浏览器中打开并开始下载。
这是我的密码
include("mpdf/mpdf.php");
$mpdf=new mPDF();
$html = 'some html'
$mpdf->WriteHTML($html);
$mpdf->mirrorMargins = 1;
$mpdf->SetDisplayMode('fullwidth','continuous');
$mpdf->output();
exit();网络服务器有什么问题?
编辑
我发现这是由于IDM的安装,如何防止IDM下载文件
发布于 2013-06-18 06:53:54
也许服务器发送了不同的头信息。
// set these two header to open the file in your browser
header("Content-Type: application/pdf");
header("Content-Disposition: inline; yourfilename.pdf");
include("mpdf/mpdf.php");
$mpdf=new mPDF();
$html = 'some html'
$mpdf->WriteHTML($html);
$mpdf->mirrorMargins = 1;
$mpdf->SetDisplayMode('fullwidth','continuous');
$mpdf->output();
exit();https://stackoverflow.com/questions/17161318
复制相似问题