//文件上传到uploads文件夹
$path='uploads';
//要上传的文件名已经给了变量$fileInfo['name']
$uniName=$fileInfo['name'];
$destination=$path.'/'.$uniName;
$filenames1=scandir($path);
if ($fileInfo['name']=foreach ($filenames1) {
echo "<script language=\"JavaScript\">\r\n";
echo " alert(\"文件名已存在请重命名后重新上传\");\r\n";
echo " history.back();\r\n";
echo "</script>";
exit;
}
theone_daxia