Re: displaying a pdf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 June 2011 06:53, Tamara Temple <tamouse.lists@xxxxxxxxx> wrote:
>
> On May 30, 2011, at 10:01 AM, Jim Giner wrote:
>
>> Thanks for the attempt Simon, but your code only displayed gibberish.
>> While looking around again for help, I found this and it works perfectly:
>>
>> <?php
>> session_start();
>> //
>> // ÂSpecify the name of the pdf here and the folder
>> //
>> $pdfname='VFD_ByLaws.pdf';
>> $path='/pdfs/';
>> //
>> // Âthe rest will handle the displaying
>> //
>> header("Cache-Control: no-cache");
>> header("Content-type: application/pdf");
>> header("Location:$path$pdfname");
>> ?>
>
> I may not be fully understanding this, but if you set a Location: header,
> the other headers you've set don't matter at all, since the client will
> merely redirect to the page specified by the Location: header.

Yes. That's true. But the URL you link to is the one responsible for
sending the headers to download a PDF.

Just like if it was a link ...

<a href="download_pdf.php">Got your PDF here</a>

download.pdf.php would send the appropriate headers.



-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux