note 50178 deleted from function.move-uploaded-file by tularis
| From: | tularis@php.net | Date: | Sun, 20 Feb 2005 23:40:58 +0000 |
| Subject: | note 50178 deleted from function.move-uploaded-file by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-85296@lists.php.net to get a copy of this message | ||
Note Submitter: pedro_sacramento at yahoo dot com
Reason: useless
----
Here is a sample script for uploading multiple files at once.
<!-- index.php - starts here -->
<?
if ($_GET['cmd'] == "upload")
{
for ($i = 0 ; $i < count($_FILES['sample']['name']) ; $i++){
move_uploaded_file(
$_FILES['sample']['tmp_name'][$i],
"upload_dir/".$_FILES['sample']['name'][$i]
);
}
}
?>
<html>
<body>
<form action=index.php?cmd=upload method=post enctype="multipart/form-data">
<input type=file name=sample[]><br>
<input type=file name=sample[]><br>
<input type=file name=sample[]><br>
<input type=hidden name=MAX_FILE_SIZE value=1024>
<input type=submit>
</form>
</body>
</html>
<!-- index.php - ends here -->
Hope it helps :)
<Pedro Sacramento/>