$maxsize){ echo "文件过大"; exit; } //修改文件名 以时间戳命名 $randname=date("Y").date("m").date("d").date("H").date("i").date("s").rand(100, 999).".".$imgType; //检验文件是否是通过HTTP POST上传 if(is_uploaded_file($file["tmp_name"])){ $filepath = '../UserPhoto/';//保存文件路径 move_uploaded_file($file["tmp_name"],$filepath.$randname); $randname1 = "https://api.966120.com.cn/UserPhoto/".$randname; $return = array( "SnsImg" => $randname1, "result" => "1" ); echo $randname1; }else{ exit; } ?>