note 21231 deleted from features.file-upload by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 09:01:56 +0000 |
| Subject: | note 21231 deleted from features.file-upload by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196839@lists.php.net to get a copy of this message | ||
Note Submitter: solja at gci dot net
----
Just another way I found to keep an uploaded file from overwriting an already exisiting one - I
prefix each uploaded file with time() timestamp. Something like:
$unique_id = time();
Then when I give the new name to move the file to, I use something like:
$unique_id."-".$filename
So I get a fairly unique filename each time a file is uploaded. Obviously, if two files are uploaded
at once, both will have the same timestamp, but I don't worry too much about that. Hope this
might help someone.