note 14995 deleted from features.file-upload.multiple by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 20:39:44 +0000 |
| Subject: | note 14995 deleted from features.file-upload.multiple by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25407@lists.php.net to get a copy of this message | ||
One More Example:
Create a form like so (you can have as many file input elements as you need, BUT(!!!!!) be sure to
name each input elment with a unique name):
<form ........>
<input type="File" name="file1[]"><br>
<input type="File" name="file2[]"><br>
<input type="File" name="file3[]"><br>
<input type="submit" value="Upload">
</form>
Now the function to handle upload:
function handle_upload($HTTP_POST_FILES) {
$filecount = 1; //keep track of each file
foreach($HTTP_POST_FILES as $akey => $value) {
if(!empty($HTTP_POST_FILES[$akey]["name"][0])) {
echo "File #".$filecount.":
".$HTTP_POST_FILES[$akey]["name"][0]."<br>"; //for debug only
/*
code to handle uploaded files goes here
*/
}
else {
echo "File #".$filecount.": not uploaded<br>"; //for debug only
}
$filecount++; //next file
}
return true;
}
}