Re: Accessing pdf file thru php

From: Date: Wed, 12 Sep 2001 14:01:19 +0000
Subject: Re: Accessing pdf file thru php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67044@lists.php.net to get a copy of this message
Brad, Thanks for that pointer. However, with that implemented, all I get is the PDF coding dumped onto the screen - no pdf file downloaded! Any further suggestions. I feel as though I'm getting there . . . slowly. George ----- Original Message ----- From: "Brad S. Jackson" <bjackson@McLeodUSA.com> To: "George Pitcher" <fmdev@yahoo.co.uk> Sent: Wednesday, September 12, 2001 2:52 PM Subject: Re: [PHP] Accessing pdf file thru php > > > You should call header() for each header line. And you should only send one > content type header. > > header("Content-type: application/pdf"); > header("Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf"); > header("Content-Length: $len"); > > > "George Pitcher" <fmdev@yahoo.co.uk> wrote: > Hi all, > > I'm trying to build php into an existing solution which uses Lasso. > > I have tested the passing of data from Lasso to php and that works fine. > > I want Lasso to pass the filename over to a php page and for that page to > grab the file from a folder outside of the webroot and push it out to the > user, at the same time as presenting them with a confirmation form so that > downloading can be confirmed. > > I have tried the following code without any good results: > > <?php > $filename="D:\\Pdf\\0226138097(57-77).pdf"; > $len = filesize($filename); > $header=" > Content-type: application/pdf > Content-type: application/x-octet-stream > Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf > Content-Length: $len"; > header=($header); > readfile($filename); > ?> > > I get a parse error on the line that calls the header. > > Can anyone help me with this please? > > Regards > > George Pitcher > > Technical Manager > HERON Project > Napier University > Edinburgh EH10 5DT > > fmdev@yahoo.co.uk > gep1@stir.ac.uk > safc2_1nufc@yahoo.com > > http://www.heron.ac.uk > ================================================ > programmer - A device for transmuting caffeine into code. > ================================================ > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

« previous php.general (#67044) next »