Re: path problems
| From: | Scott Taylor | Date: | Wed, 28 Jan 2004 21:05:23 +0000 |
| Subject: | Re: path problems | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176123@lists.php.net to get a copy of this message | ||
Yes, the error I get is a pop-up box saying "This is not a valid %PDF file"
Here is my code:
$file_two = 'archive/newsletters/Dec03PostPress.pdf'; //now view the PDF file
header("Content-Type: application/pdf");
header("Accept-Ranges: bytes");
header("Content-Length: ".filesize($file_two));
readfile($file_two);
Now I would think that I wasn't using the correct headers or that the file didn't exist or something of that nature, but since I get no error with the full url, I have more or less figured it was problem with loading a file from the local file system instead of the file itself being corrupt, etc.
Thanks for the help,
Scott Taylor
- Edwin - wrote:
On Tue, 27 Jan 2004 20:22:46 -0500 Scott Taylor <scotttaylor@bigfoot.com> wrote:I understand all of the file size ones. What I really don't understand is why neither of the following examples work: /* example 1 */ /* where $_SERVER['DOCUMENT_ROOT'] = /usr/local/psa/home/vhosts/domain.com/httpdocs */$file = $_SERVER['DOCUMENT_ROOT'] . '/archive/newsletters/Dec03.pdf'; readfile($file); /* example 2 */ $file = 'archive/newsletters/Dec03.pdf'; readfile($file);How does it not work? Errors, anything? -- - E - __________________________________________________ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/