note 21231 added to features.file-upload

From: Date: Fri, 03 May 2002 22:11:27 +0000
Subject: note 21231 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-30152@lists.php.net to get a copy of this message
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. -- http://www.php.net/manual/en/features.file-upload.php http://master.php.net/manage/user-notes.php?action=edit+21231 http://master.php.net/manage/user-notes.php?action=delete+21231 http://master.php.net/manage/user-notes.php?action=reject+21231

« previous php.notes (#30152) next »