Topic: Access user for non html files (Read 1887 times)
Metal slug addict
Posts: 18
132 credits Members referred : 0
« on: Aug 06, 2006, 11:36:18 pm »
Hi,
I'm having great success using this class as a basis for protecting my site. I would appreciate any pointers from you how I can protect non-html files (PDF, zips, etc) using this class.
Regards, Jeff
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Aug 07, 2006, 12:10:28 am »
Hello Jeff,
You need to protect a directory with files using a .htacces file.
while using file functions its possible to open files while the folders are protected with .htaccess (I do the same to protect hot linking of my classes)
Metal slug addict
Posts: 18
132 credits Members referred : 0
« Reply #2 on: Aug 07, 2006, 12:38:01 am »
I think I understand this but just to be clear............
Use an .htaccess fie to protect the download directory.
Even though there is no communication between php and .htaccess the fact that you will be downloading the file by using the links to the files that you have provided on the page that is protected with access user class it should work correct?
Thanks. If my understanding is correct you have given the first explanation of this that I finally can understand.
Jeff
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #3 on: Aug 07, 2006, 12:56:18 am »
yes right, a php script acts with the rights of the server admin thats why it's possible.
Metal slug addict
Posts: 18
132 credits Members referred : 0
« Reply #4 on: Aug 08, 2006, 03:47:09 pm »
Thanks Olaf. Worked perfectly. You do have a typo in the code at your site.
$fullPath = $path.$_GET['downnload_file'];
downnload should only have one n.
Best regards, Jeff
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374