|
Posted by Erwin Moller on 05/30/06 09:39
jerryyang_la1@yahoo.com wrote:
> Hi.
>
Hi,
> I'm looking for a way to allow users to download files, but what files
> they see and can download need to be restricted to their username..
If their username is a unix username (real user) than .htaccess could be of
use.
If the users are unrelated (eg Database-stored) to systemusers, you'll have
to use PHP to deliver the file.
>
> I will have a couple of users who will have full access, the others
> need to see only the files I have allocated to them.
>
> Can this be done ?
>
Yes.
Just place the files in a directory where nobody can access them directly
via a http-request.
Let PHP, once you agreed that the user should be ok, read the file and give
it to the user.
So the PHP-user (on *nix often: apache, or nobody, or www-data) should of
course have read-right on all the files for this to work.
> Any scripts available to do this ?
No idea. Quite basic stuff.
You can roll your own.
Have a look at www.php.net, and look for fopen() and the other
filefunctions.
>
> Thanks
Good luck.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|