这是Mysql的,道理都一样<?
include("common.inc");
include("security.inc");
if (isset($upload)){
for( $r=0;$r<count($myfile);$r++){
if ($myfile_name[$r]<>"" and $myfile_name[$r]<>"null"){
if ($myfile_size[$r]>2048000)    {
$str=$str.($r+1).".文件 ".$myfile_name[$r]." 字节数为 ".$myfile_size[$r]." 超过规定大小(2M),上载失败!\\n";
}
//elseif ($myfile_type[$r]<>"image/pjpeg")    {
//    $str=$str.($r+1).".文件 ".$myfile_name[$r]." 格式错误,上载失败!其格式为:".$myfile_type[$r]."\\n";
//}
else{        
$filesize=filesize($myfile[$r]);
$data = addslashes(fread(fopen($myfile[$r],"r"),$filesize));
$sql="insert into upload (filesize,filetype,filedata,memo) values ('".$filesize."','".$myfile_type."','".$data."','".$memo."')";
mysql_query($sql,$conn);
$str=$str.($r+1).".文件 ".$myfile_name[$r]." 上载成功!文件大小:".$myfile_size[$r]."; \\n\\n";
}
}
}
if (strlen($str)>0){
echo "<script language=JavaScript>alert('".$str."');</script>";
}    
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
<head>
<title>上传</title>
<META HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
</head>
<body style='font-size:9pt;'>
<table width="600" border="0" align="center" style="font-size:9pt;" cellspacing="0" cellpadding="3">
<tr><td style='font-size:14px' colspan=2><b>上传</b></td>
<form name="uploadfile" method="POST" enctype="multipart/form-data"  
action="<?=$PHP_SELF;?>" >
<tr bgcolor="Cornsilk">
<td align="right">文件一:</td><td><input type='file' size='40' maxlength='60' name='myfile[]'></td>
</tr>
<tr bgcolor="Cornsilk">
<td align="right">文件二:</td><td><input type='file' size='40' maxlength='60' name='myfile[]'></td>
</tr>
<tr bgcolor="Cornsilk">
<td align="right">文件三:</td><td><input type='file' size='40' maxlength='60' name='myfile[]'></td>
</tr>
<tr bgcolor="Cornsilk">
<td align="center" colspan="2" height="40"><input type="submit" name="upload" value=" 开 始 上 传 "></td>
</tr>
</form>
</table></body>
</html>
 
上面这个例子一次可以上传1~3个文件
修改一下上传多少个文件都可以,关键看网络速度。