0) { echo "上传出错: " . $_FILES["file"]["error"] . ""; } else { //输出文件信息 /*echo "文件名: " . $_FILES["file"]["name"] . ""; echo "类型: " . $_FILES["file"]["type"] . ""; echo "大小: " . ($_FILES["file"]["size"] / 1024) . " Kb"; echo "临时路径: " . $_FILES["file"]["tmp_name"] . "";*/ //判断文件是否已存在 if (file_exists("images/" . $_FILES["file"]["name"])) { echo ""; } else { //造存储路径 $filename = "images/" . $_FILES["file"]["name"]; //移动图片至保存路径,解决中文乱码问题 move_uploaded_file($_FILES["file"]["tmp_name"],iconv("UTF-8","gb2312",$filename)); echo "该文件存储在了: " . "images/" . $_FILES["file"]["name"]; echo ""; } } } else { echo "上传失败"; }?>