Welcome Guest, Not a member yet? Register   Sign In
renaming uploaded picture
#1

[eluser]$ilovephp[/eluser]
Hello everyone!

I did a benchmarking at different sites and found out that they will rename the uploaded picture. Renaming an uploaded photo isn't hard at all using the configuration in the Upload Class (thanks to the power of CI).

But my question is, if other sites did the renaming, what are there basis in naming convention? Are they doing hashing? Any method would be greatly appreciated. Thanks.
#2

[eluser]pickupman[/eluser]
I know I have used a md5 on the filename appended to the microtime(), and sometimes thrown the user id in the mix for fun. This creates a random filename, that would be not get duplicated.
#3

[eluser]$ilovephp[/eluser]
[quote author="pickupman" date="1272349822"]I know I have used a md5 on the filename appended to the microtime(), and sometimes thrown the user id in the mix for fun. This creates a random filename, that would be not get duplicated.[/quote]

thanks! this a great help.. why haven't think of microtime and then hashed with md5... thanks again




Theme © iAndrew 2016 - Forum software by © MyBB