Re: Displaying PDF file

From: Date: Thu, 12 Sep 2002 14:43:22 +0000
Subject: Re: Displaying PDF file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-116160@lists.php.net to get a copy of this message
Joseph Szobody wrote: > I've made a website for a real estate appraiser, who wants to put all > his appraisals for his clients online. I have stored these PDF > documents in a folder outside of the webserver folder, for security. > When a client successfully logs in and clicks the link to biew the > PDF, I have a PHP script that does the following: > > <? > Header("Content-type: application/pdf"); > > include("../pdfs/whatever.pdf"); > ?> Include is the statement used for including other php files. That means that the pdf you're including will be parsed by the parser. I have no idea why some document don't give errors. You will have to use readfile instead: readfile( "../pdfs/whatever.pdf"); HTH Erwin

« previous php.general (#116160) next »