Hi,
I am trying to get an uploaded file to be rename upon upload with a unique name, so if two users upload the same titled file, one user's file doe not get overwritten by the new one.
I got it to work, to some extent, but the best way I managed is by getting the file to be renamed with a new name taken from a data / time variable:
$rename = date("Y-m-d-H-i-s");
so my file upon upload is renamed to: 2006-04-19-12-29-46.pdf for instance.
That's pretty good to me, but I'm just worried about "what if two users upload their file at the very same second?"
Is that possible?
if so, how could i rename my file with a unique, php generated number?
is it possible?
something like $rename = raddom10gigitsnumber
know what I mean?
many thanks,
Vinny