Results 1 to 16 of 16
Thread: Keeping Images Unique
Feb 12, 2012, 14:44 #1
- Join Date
- Aug 2010
- 2 Post(s)
- 0 Thread(s)
Keeping Images Unique
I am building a "User Profile" feature on my website, including allowing Users to uploads a Profile Picture.
The problem is that two separate Users could have a Picture with the same name (e.g. "me.jpg").
What is the best way to handle this in my Upload Script?
One person I know suggested having a "User Folder" for every User. But what happens if my website grows to 20,000 Users? (That has got to be enough to make even a Linux Server choke?!)
I could append the "UserID" to each Image, but since it starts at "1" currently, that would look weird. Plus, you would want it fixed-width like "000001".
I could append the "Email", but that isn't very reliable. (I am wondering if I should have made people create a "Username" too...)
What do you think I should do?