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";
精彩评论