Original Post
I'm creating a web-service that allows users to upload photos that can then be viewed by other users.
My question is: what is the best way to file manage this, especially as file names go?
I thought about allowing the user to upload, say shark.jpg and then the database would make a record in the images table as such:
autoID = 13827, uploader = tim33, localFileAlias = shark.jpg, trueFileName = f892y839572inksui90.jpg
trueFileName would be the actual file name on the server in the images directory. And be generated randomly, making sure the file name doesn't already exist. (i don't like hashing for this since if anyone figures out my seeds (user names, localFileAlias, etc.) they'd be that much closer to finding the true file name)
and the true file name being changed every time the file is accessed <-- is this of any value?
-I don't want people to be able to guess file names and view images that another user might want kept private.
-I don't want people to able to arbitrarily URL edit to view random images either.
My question is: what is the best way to file manage this, especially as file names go?
I thought about allowing the user to upload, say shark.jpg and then the database would make a record in the images table as such:
autoID = 13827, uploader = tim33, localFileAlias = shark.jpg, trueFileName = f892y839572inksui90.jpg
trueFileName would be the actual file name on the server in the images directory. And be generated randomly, making sure the file name doesn't already exist. (i don't like hashing for this since if anyone figures out my seeds (user names, localFileAlias, etc.) they'd be that much closer to finding the true file name)
and the true file name being changed every time the file is accessed <-- is this of any value?
-I don't want people to be able to guess file names and view images that another user might want kept private.
-I don't want people to able to arbitrarily URL edit to view random images either.