Home >Backend Development >PHP Tutorial > upload.php ->文件上传

upload.php ->文件上传

WBOY
WBOYOriginal
2016-06-13 12:36:041621browse

upload.php --->文件上传

header("Content-type:text/html;charset=utf-8");
print_r($_FILES['file']);

$filename=$_FILES['file']['name'];

if(!$_FILES['file']['error'])
{
      if(move_uploaded_file($_FILES['file']['tmp_name'],"./upload/".$filename))
       {
              echo  "文件上传成功";
        }else{
               echo  "文件上传失败";
          }
}else{
      echo  "文件上传错误";
  }
?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn