sam15
asked on
Protect_fiile
If i have a public directory on Apache with a few public files.
is it possible to add one file and protect it using userid/password or password only.
How can i do this
Is it possible also to upload it to a database table and have a link to it that opens it like a file system. That would require more code though.
is it possible to add one file and protect it using userid/password or password only.
How can i do this
Is it possible also to upload it to a database table and have a link to it that opens it like a file system. That would require more code though.
ASKER
so you can restrict access to a file in a specific directory or create a protected diretory and limit access to it?
Do you have to mess up with the main .htaccess and .paswrd files or you create a second copy and place it in this directory.
Do you have to mess up with the main .htaccess and .paswrd files or you create a second copy and place it in this directory.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great one last question
can I have one userid/password for ALL users or one userid/password for everyone. Does apache allow you to configure both.
can I have one userid/password for ALL users or one userid/password for everyone. Does apache allow you to configure both.
You can make one or many userid/passwords. The example only requires a "valid-user" which just means they exist in the .htpasswd file. Another option is to just use one userid, but change the pw now and again and only send the new password to those who should have it currently. You can't really track who is doing what this way.
Here is a decent description:
http://www.euronet.nl/~arnow/htpasswd/documentation.html
As for uploading an image to a database and retrieving it as a file: You can do this with MySQL and PHP.
Here is the basic way to it:
http://www.wellho.net/solutions/php-example-php-form-image-upload-store-in-mysql-database-retreive.html