时间:2021-07-01 10:21:17 帮助过:4人阅读
if($_FILES["file"]["error"] > 0)
{
echo "Error : ".$_FILES["file"]["error"]."
";
}
else
{
echo "Upload: ".$_FILES["file"]["name"]."
";
echo "Type: ". $_FILES["file"]["type"]."
";
echo "Size: ".($_FILES["file"]["size"]/1024)."KB
";
echo "Stored in: ".$_FILES["file"]["tmp_name"]."
";
if(file_exists("upload/".$_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"]." already exists.";
}
else
{
//move_uploaded_file($_FILES["file"]["tmp_name"], "upload/".$_FILES["file"]["name"]);// 报错
move_uploaded_file("upload/".$_FILES["file"]["name"],$_FILES["file"]["tmp_name"]);
echo "
Storeed in: "."upload/".$_FILES["file"]["name"];
}
}
?>