Re: Re: alternative to protecting files through http auth.
| From: | Jason Wong | Date: | Sun, 18 Jan 2004 01:56:13 +0000 |
| Subject: | Re: Re: alternative to protecting files through http auth. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174945@lists.php.net to get a copy of this message | ||
On 星期日 18 一月 2004 01:59, Scott Taylor wrote:
> Yes, sorry. Here is the code: $file =
>
> 'http://miningstocks.com/protected/archive/Dec03PostPress.pdf';
> //now
> view the PDF file header("Content-Type: application/pdf");
> header("Accept-Ranges: bytes"); header("Content-Length:
> ".filesize($file)); readfile($file); I can send the rest if necessary.
You're telling PHP to get the file using HTTP, thus subjecting it to Apache's
protection mechanism.
You need to get the file via the filesystem:
readfile('/local/path/to/file.pdf');
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The absence of labels [in ECL] is probably a good thing.
-- T. Cheatham
*/