Re: Need Some Direction
| From: | Torsten Roehr | Date: | Thu, 05 Aug 2004 21:44:37 +0000 |
| Subject: | Re: Need Some Direction | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192940@lists.php.net to get a copy of this message | ||
"Aaron Todd" <aaloki88@hotmail.com> wrote in message
news:20040805204218.57433.qmail@pb1.pair.com...
> So far I have made this work. But now I have to ask...what about a pdf
> file? I cant add php code to it so what do I do. I need to be able to
> restrict the pdf so a user can only get to it during a current session.
>
> Thanks again for all the previous posts. You all directed me to a good
> place. My pdf files sliped my mind when I posted. I should have added
this
> problem before.
>
> I hope it can still be done.
>
> Thanks,
>
> Aaron
Hi Aaron,
put your pdf file outside of the webroot our in a .htaccess protected
directory. Then read in the file contents, set the appropriate headers and
output the file contents to the browser - this should prompt a download
window.
PEAR's HTTP_Download is excellent for this job:
http://pear.php.net/package/HTTP_Download
Regards, Torsten