标签:div 文件 manual store file move dir pre sts
<?php if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; $uploaddir = "D:/xampp/htdocs/upload/files/"; $uploadfile = $uploaddir . $_FILES["file"]["name"]; if (file_exists($uploadfile )){ echo $_FILES["file"]["name"] . " already exists. "; }else{ move_uploaded_file($_FILES["file"]["tmp_name"],$uploadfile); echo "Stored in: " . $uploadfile; } } ?>
参考:http://php.net/manual/zh/features.file-upload.errors.php
标签:div 文件 manual store file move dir pre sts
原文地址:http://www.cnblogs.com/mttnor/p/PHP.html