0

I'm working in php and want to make directories for each user where I would store their uploaded images. Only the user can access his/her directory and respective images.

I couldn't find much documentation on how to do this, namely creating directories, best place to put them in my server, how to link them to a user, and setting them to private. Please share your guidance on where to start. What is the standard practice?

CyberJunkie
  • 21,596
  • 59
  • 148
  • 215
  • "Only the user can access his/her directory and respective files" are you asking how to create a cloud storage system such as dropbox? – Paul Dessert Jul 11 '12 at 00:13
  • @Paul no it isn't for a storage application but I'll probably have to implement similar functions just much more basic. – CyberJunkie Jul 11 '12 at 00:17

1 Answers1

2

You should consider to put Files with restricted access outside the public webroot folder and serve them via PHP, which will enable you to check the users credentials before. (see Fastest Way to Serve a File Using PHP)

That way you might not need one directory per user.

Community
  • 1
  • 1
gherkins
  • 14,603
  • 6
  • 44
  • 70