views:

47

answers:

1

Im having photo albums on my site which will be a vital part of the website and most users will upload images, lets say i get 10.000 visitors with an avarge upload of 10 images =100.000 images, should each visitor get his own folder MKDIR() or should i just store all the images in the same folder? there is no risk for images having the same name or anything

but i just wonder what is best practice

+3  A: 

By putting too many files in one folder, you're risking hitting limits of the filesystem of use. You didn't mention what filesystem is going to store all those images, but indeed all of them have some sort of limits (or it may slow things down). You'd better put each users images in their own folders.

racetrack
I'd tend to agree, if only for tidyness. `wwwroot/app_assets/user_uploads/[username]/image.jpg`
rockinthesixstring
Due to the filesystem limits I also tend to use something like: `some/path/[top bits of user id]/[rest of user id]/files_go_here`
slebetman
thanks guys....
FlavourFlave