upload.php ->文件上传

WBOY
Release: 2016-06-13 12:36:04
Original
1603 people have browsed it

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  "文件上传错误";
  }
?>

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!