php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23054 Can not display PDF file on screen using @readfile($pdfFile)
Submitted: 2003-04-04 09:58 UTC Modified: 2003-04-04 10:41 UTC
From: cindylu at jdbarnes dot com Assigned:
Status: Not a bug Package: PDF related
PHP Version: 4.3.0 OS: Linux
Private report: No CVE-ID: None
 [2003-04-04 09:58 UTC] cindylu at jdbarnes dot com
If I create a test.php file with the following code, I put that test.php on the website. the code will show the pdf on the screen. It works ok.
<?php
header("Content-Type: application/pdf");
@readfile($pdfFile);
?>

But if I put  these few lines of code in my php, it does not show the pdf file on the screen.
<?php
$pdffile = myCreatePDF_function($myHTML);
//I know my pdf file is created, because if I stop here, I can see my pdf file and I can use my test.php to show my pdf file on screen.
//But if I put the code in here. It does not work.
header("Content-Type: application/pdf");
@readfile($pdfFile);
exit();
?>

Can anyone tell me why?

Any comments are highly appreciated.

Cindy

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-04 10:41 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is definately not any bug in PHP. 

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC