时间:2021-07-01 10:21:17 帮助过:26人阅读
if ($_FILES["upload_file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["upload_file"]["error"] . "
";
}
else
{
echo "Upload: " . $_FILES["upload_file"]["name"] . "
";
echo "Type: " . $_FILES["upload_file"]["type"] . "
";
echo "Size: " . ($_FILES["upload_file"]["size"] / 1024/1024) . " MB
";
echo "Temp file: " . $_FILES["upload_file"]["tmp_name"] . "
";
move_uploaded_file($_FILES["upload_file"]["tmp_name"],
"D:/xampp/htdocs/ca/doc/" . $_FILES["upload_file"]["name"]);
echo "Stored in: " . "D:/xampp/htdocs/ca/doc/" . $_FILES["upload_file"]["name"];
}
$name=$_FILES["upload_file"]["name"];
$size=floor($_FILES["upload_file"]["size"] / 1024/1024 )."MB";
$loc="doc/" . $_FILES["upload_file"]["name"];
echo "
";
?>