note 69531 added to function.move-uploaded-file
| From: | cameron at osu1 dot php dot net | Date: | Fri, 08 Sep 2006 23:39:45 +0000 |
| Subject: | note 69531 added to function.move-uploaded-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116947@lists.php.net to get a copy of this message | ||
In response to theprocrastinator's contribution 2 notes down, don't forget the same user
actually could be uploading more than one document at the same time, if the form contained multiple
"file" input elements.
Consider an application that allows users to upload multiple photos for a project - they would all
have the same (username_timestamp.jpg) filename.
The solution is to tack on an additional piece, namely the index of each upload in the
$_FILE['blahblah']['name'] array, so that each file is named:
username_timestamp_0.jpg
username_timestamp_1.jpg
...etc...
Simple enough.
----
Server IP: 64.71.164.2
Probable Submitter: 70.177.20.233
----
Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php
Edit -- https://master.php.net/note/edit/69531
Del: integrated -- https://master.php.net/note/delete/69531/integrated
Del: useless -- https://master.php.net/note/delete/69531/useless
Del: bad code -- https://master.php.net/note/delete/69531/bad+code
Del: spam -- https://master.php.net/note/delete/69531/spam
Del: non-english -- https://master.php.net/note/delete/69531/non-english
Del: in docs -- https://master.php.net/note/delete/69531/in+docs
Del: other reasons-- https://master.php.net/note/delete/69531
Reject -- https://master.php.net/note/reject/69531
Search -- https://master.php.net/manage/user-notes.php