note 79472 deleted from features.fileupload.multiple by tularis
| From: | tularis@php.net | Date: | Thu, 29 Nov 2007 09:09:18 +0000 |
| Subject: | note 79472 deleted from features.fileupload.multiple by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-132653@lists.php.net to get a copy of this message | ||
Note Submitter: sevoir75 at gmail.com
Reason: useless
----
<form enctype="multipart/form-data" action="uploader.php"
method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a files to upload: <br>
<input name="uploadedfile[]" type="file" /><br />
<input name="uploadedfile[]" type="file" /><br />
<input name="uploadedfile[]" type="file" /><br />
<input name="uploadedfile[]" type="file" /><br />
<input name="uploadedfile[]" type="file" /><br />
<input type="submit" value="Upload Files" />
</form>
<?php
// Where the file is going to be placed (uploader.php)
$target_path = "uploads/";
/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
for ($x=0;$x<6 ; $x++){
if (strlen($_FILES['uploadedfile']['name'][$x])>0){
$target_path = $target_path . basename( $_FILES['uploadedfile']['name'][$x]);
$_FILES['uploadedfile']['tmp_name'][$x];
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name'][$x]);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'][$x], $target_path)) {
echo "<br>The file ". basename(
$_FILES['uploadedfile']['name'][$x]).
" has been uploaded";
} else{
echo "<br>There was an error uploading the file, please try again!";
}}}
?>