if (move_uploaded_file($fileInfo['tmp_name'],$destination)) {? //判斷文件名是否重名? if (file_exists($fileInfo['name'])) {??? echo "<script language=\"JavaScript\">\r\n";??? echo " alert(\"文件已存在請(qǐng)重命名后創(chuàng)建\");\r\n";??? echo " history.back();\r\n";??? echo "</script>";??? exit;? }else{? echo "<script language=\"JavaScript\">\r\n";? echo " alert(\"文件上傳成功\");\r\n";? echo " history.back();\r\n";? echo "</script>";? exit;}}點(diǎn)擊上傳還是會(huì)有提示框顯示:文件已存在請(qǐng)重命名后創(chuàng)建?
上傳文件時(shí)判斷是否存在相同名稱(chēng)文件代碼問(wèn)題
慕仔8661472
2016-07-31 22:30:48