mjfroggy
07-14-2008, 09:30 AM
Hello I have a few video files that I wantto prevent anyone who is not logged in to access. So fo example if they are logged in their is a page that lists the files and they click on a link to download it.
The issue is I am not sure how to stop someone from being able to go directly to www.domain.com/files/thefile.zip
and directly downloading it?? I have a php/mysql database system setup for login but I am not sure how to prevent people from just going directly to the files url. I thought maybe put a .htaccess file in the directory to password protect the directory but then that prevents the users who logged in (using my php/mysql userlogin system) from downloading the files.
So then my next thought is maybe their is a way to .htaccess password protect a directory and have php be able to pass the .htaccess a user/pass to validate the person as being able to download a file?? but not sure how todo that??
Or is their a better way? I would love to put the files above the public_html folder but can not figure out how then to allow logged in members to be able to click a link in a page to download it??
The issue is I am not sure how to stop someone from being able to go directly to www.domain.com/files/thefile.zip
and directly downloading it?? I have a php/mysql database system setup for login but I am not sure how to prevent people from just going directly to the files url. I thought maybe put a .htaccess file in the directory to password protect the directory but then that prevents the users who logged in (using my php/mysql userlogin system) from downloading the files.
So then my next thought is maybe their is a way to .htaccess password protect a directory and have php be able to pass the .htaccess a user/pass to validate the person as being able to download a file?? but not sure how todo that??
Or is their a better way? I would love to put the files above the public_html folder but can not figure out how then to allow logged in members to be able to click a link in a page to download it??
