note 45784 added to features.file-upload.multiple
| From: | d dot hartmannatwebfunktion dot de at osu1 dot php dot net | Date: | Sat, 18 Sep 2004 16:42:50 +0000 |
| Subject: | note 45784 added to features.file-upload.multiple | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76945@lists.php.net to get a copy of this message | ||
First Way:
<input type="file" name="uploadfile[]"/>
<input type="file" name="uploadfile[]"/>
Second Way:
<input type="file" name="uploadfile[0]"/>
<input type="file" name="uploadfile[1]"/>
In Upload.php:
for ($i=0;$i<2;$i++) {
if ($_FILES["uploadfile"]["tmp_name"][$i]) {
move_uploaded_file(
$_FILES["uploadfile"]["tmp_name"][$i],
$_FILES["uploadfile"]["name"][$i]);
}}
Both works fine, if the client loads 2 Files.
Both works also fine, if the client loads only the first file.
But there no way to use move_uploaded_file, if the client likes only to load the second one.
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.multiple.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45784
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45784&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45784&report=yes
Search -- http://master.php.net/manage/user-notes.php