Thankyou Robert, THat is a great and easy way to do it. What if I need to initiate a download to the user?
-----Original Message----- From: Robert Cummings [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 2:06 PM To: David Buerer Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP] secure files acess 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:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'