user management for file upload

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jimmah
Forum Newbie
Posts: 2
Joined: Sat Feb 19, 2005 6:38 am
Location: Manchester, UK

user management for file upload

Post by jimmah »

Hi guys,
I've got a file upload script working on my server. What i really want to do with it is, have it so only authorised users can access it, and also each user should upload to a separate directory. Any ideas?
Thanks

Jim
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

use sessions w/ db to store authorize users names and upload dir info and script utilizing this info.
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Post by Trenchant »

I would just update the file upload class so that first of all only registered users can upload images. Then save the image names as (userid)_(users specific image ID).gif or whatever ending like that.

Then just keep image information in a database so you match image id with image infor and userid with user info. You could also get away with just making an image id and not including the user id.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

it isn't hard to create directories.. it isn't hard to make sure those names allow you to identify the user... usually this is done by naming the directories the same as the user... just read the fine php manual on filesystem operations....
jimmah
Forum Newbie
Posts: 2
Joined: Sat Feb 19, 2005 6:38 am
Location: Manchester, UK

Post by jimmah »

cheers guys,

will give your suggestions a go.

jim
Post Reply