I'm designing a file upload system and I want to find a good way to assign a random filename to uploaded images as well as have a good way to spread '000s of uploaded files across several directories to speed up access.
Previously I used a naming convention like userid_imgnum.jpg but that's too easy to guess and I don't want anybody to be able to directly access the files. Also I'm looking for a good directory system to store the uploaded files. I've seen recommendations to create directories like:
images/a/ : filenames beginning with 'a'
images/b/ : filenames beginning with 'b'
etc
But I suppose there may be a better way?