日期:2014-05-16 浏览次数:20565 次
<?php
if ($_FILES["upload_file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["upload_file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["upload_file"]["name"] . "<br />";
echo "Type: " . $_FILES["upload_file"]["type"] . "<br />";
echo "Size: " . ($_FILES["upload_file"]["size"] / 1024/1024) . " MB<br />";
echo "Temp file: " . $_FILES["upload_file"]["tmp_name"] . "<br />";
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 "<br/>";
?>