开发者

php uploading file

I got EVERYTHING, but this working. I can't get the move_uploaded_file(); to work.

$ups_path = "ups/files";
$nfile = $_FILES['开发者_StackOverflow中文版nfile']['tmp_name'];
$cfile = move_uploaded_file($nfile, $ups_path);

if($cfile){
header ('Location: index.php?give=fileuploaded');
} else {
header ('Location: index.php?give=filenotuploaded');
}

It always returns the error for not moving it.


If ups/files a directory then this will fail. move_uploaded_file expects the second argument to be a filename, not a directory.


Try using the absolute path instead of relative one:

$ups_path = "/var/www/somewhere/ups/files";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜