Creating a unique image name hash for a website with image uploads
I have a website that accepts user-uploaded images. I wa开发者_开发技巧nt to give each uploaded image a unique name. I will be physically storing the images on the file system and saving the file-name of the image in my database. What is a good way to accomplish this?
you can name it a substring of a md5 hash made of the users id and the time
I don't see any reason not to use an autogenerated ID field in the table and make that the file name as well.
精彩评论