Thursday, July 14, 2011
Storing and retrieving user images in PHP?
I wanted to make a website where users can upload their own images but I ran into a few problems. I started out using blobs and I realized that was not a very good idea, so I've been down that road. I decided to store the images in a directory and then store the image names into the database so that I can easily call them in the code. I noticed that if a user uploads an image with the same name as another image in the directory, the first one is deleted so two users can't upload a file that is called, for example, "photo.jpg" or else one will be deleted. So here's my question: What is a simple but effective way to get around this problem? I have a few ideas but they are not very efficient. Thanks for all your help!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment