note 21011 added to features.file-upload
| From: | meto at compatibility dot info | Date: | Thu, 25 Apr 2002 10:01:41 +0000 |
| Subject: | note 21011 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29827@lists.php.net to get a copy of this message | ||
Just another way to handle multiple uploads:
<?
function upload($FVARS) {
for($i=0;$i<count($FVARS[file][tmp_name]);$i++) {
$size=$FVARS[file][size][$i]; // filesize
$type=$FVARS[file][type][$i]; // mime type
$name=$FVARS[file][name][$i]; // original name
$temp=$FVARS[file][tmp_name][$i]; // temporary name
if($size) {
//whatever to do with uploaded files
echo "original name: $name<br />";
echo "temporary name: $temp<br />";
echo "mime type: $type<br />";
echo "size: $size<hr />";
}
}
}
upload($HTTP_POST_FILES); // or $_FILES or whatever
?>
Using this function every <input type="file" name="file[]"> will be
handled.
--
http://www.php.net/manual/en/features.file-upload.php
http://master.php.net/manage/user-notes.php?action=edit+21011
http://master.php.net/manage/user-notes.php?action=delete+21011
http://master.php.net/manage/user-notes.php?action=reject+21011