note 19212 added to features.file-upload.multiple
| From: | fjeanson at yahoo dot com | Date: | Wed, 20 Feb 2002 00:35:54 +0000 |
| Subject: | note 19212 added to features.file-upload.multiple | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26816@lists.php.net to get a copy of this message | ||
by the way to grab the pointer to which name="userfile[]" points at in the html
<form>, all you need is
$userfile[0] or $userfile[$i] at index $i.
ex to upload a file:
<?
$userf = $userfile[0];
$fname = $HTTP_POST_FILES['userfile']['name'][0];
if($fname!=""){
$dat = date("d,m,y");
$fp = fopen ($userf, "rb");
$fileSize = filesize($userf);
$contents = fread($fp,$fileSize);
fclose($fp);
if ($fileSize<2000000){
$fp = fopen("$directory/$fname","wb");
fwrite($fp, $contents);
} else {
echo "<hr> Your file is way to big!!!<hr>";
}
fclose($fp);
}
?>
there u go ;)
--
http://www.php.net/manual/en/features.file-upload.multiple.php
http://master.php.net/manage/user-notes.php?action=edit+19212
http://master.php.net/manage/user-notes.php?action=delete+19212
http://master.php.net/manage/user-notes.php?action=reject+19212