开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜