Home >Backend Development >PHP Tutorial >上传文件 move_uploaded_file的有关问题

上传文件 move_uploaded_file的有关问题

WBOY
WBOYOriginal
2016-06-13 09:58:39685browse

上传文件 move_uploaded_file的问题
/*
 * Created on 2012-1-18
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */




//if (isset($_FILES["upfile"])){
 //$upfile=$_FILES["upfile"];
error_reporting(0);
$upfile=$_FILES["upfile"];

$name=$upfile["name"];
$type=$upfile["type"];
$size=$upfile["size"];
$tmp_name=$upfile["tmp_name"];
move_uploaded_file($tmp_name,'upfile/'.$name);

?>`


 上传文件
 

 

我想知道我点击上传后,文件被放到哪了,这个文件怎么设置,找不到我上传的文件
move_uploaded_file($tmp_name,'upfile/'.$name);


------解决方案--------------------
在这个php文件的同级目录中建一个新文件夹upfile,你上传的文件根据你的代码是保存在这个文件夹中的.
设置好文件夹的写权限
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