Re: secure files acess
| From: | Robert Cummings | Date: | Fri, 16 Aug 2002 21:05:43 +0000 |
| Subject: | Re: secure files acess | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113015@lists.php.net to get a copy of this message | ||
David Buerer wrote:
>
> I have a bunch of files which need to be kept secure. I need to allow a user
> access to them them based on a criteria which I can programmatically
> determine.
>
> My question, is how can I allow the user to download or view only one file
> on my computer without allowthem to just enter the URL into their browser of
> the file and view it?
Have a php script authenticate the user, then if authenticated, use the
reafile() function to output it to the user directly. Since PHP can see
more than just the web space the files just need to reside outside of
the websapce.
Cheers,
Rob.
--
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer |
:----------------------------------------------:
| Mail : mailto:robert.cummings@webmotion.com |
| Phone : (613) 731-4046 x.109 |
:----------------------------------------------:
| Website : http://www.webmotion.com |
| Fax : (613) 260-9545 |
`----------------------------------------------'