Page 1 of 1

password protect folders

Posted: Wed Jul 14, 2010 4:12 pm
by manRay
I need a way to protect folders with user content inside. I need some way of keeping a users content in an easy to retrieve style but also protected so that way they are the only one able to get inside the folder when they login. Any ideas?

Re: password protect folders

Posted: Wed Jul 14, 2010 5:00 pm
by Christopher
What web server are you using? HTTP Authentication is pretty easy to setup. Often you host will have a way to configure it from some control panel.

Re: password protect folders

Posted: Wed Jul 14, 2010 9:29 pm
by manRay
I am using a linux web server provided by godaddy.

Re: password protect folders

Posted: Thu Jul 15, 2010 10:07 pm
by manRay
Anyone else have any input?

Re: password protect folders

Posted: Fri Jul 16, 2010 5:00 am
by rhecker
The Apache manual provides details on the use of htpasswd for the creation of an encrypted password file. You then place the resulting file above the web root. Then place the .htaccess file in the directories you wish to protect. They should look something like this:

Code: Select all

authtype basic
authname ADMIN
authuserfile /data/18/1/130/82/265411/user/958741/cgi-bin/.file
require valid-user

Re: password protect folders

Posted: Fri Jul 16, 2010 1:37 pm
by manRay
How do sites like photobucket protect users' images from others? I want to do something like that.

Re: password protect folders

Posted: Fri Jul 16, 2010 8:17 pm
by manRay
So how would I open a file in a the protected folder from a script.