Friday, January 20, 2017

php - Warning: move_uploaded_file(): The second argument to copy() function

I'm working on a file upload method. But i suddenly start to get the following error, The only thing I changed was the file name. I reverted it back, but the error still persists.




Does anyone know how to solve this?



The error message is:




Warning: move_uploaded_file(): The second argument to copy()
function cannot be a directory in
/hermes/bosnaweb14a/b1717/ipg.plantationkeyartcorn/kittyrescuetnr/docs/upload.php
on line 13




Warning: move_uploaded_file(): Unable to move '/tmp/phpJki8OC' to '/' in
/hermes/bosnaweb14a/b1717/ipg.plantationkeyartcorn/kittyrescuetnr/docs/upload.php
on line 13
Fail




my php looks like this




$file_upload="true";
$file_up_size=$_FILES['file_up'][size];
$file_destination=$REQUEST['file_type'];
$file_new_name=$REQUEST['file_name'];


$file_name=$_FILES[file_up][name];
**$add="$file_destination/$file_new_name"; // the path with the file name where the file will be stored**

if($file_upload=="true"){


if(move_uploaded_file ($_FILES[file_up][tmp_name], $add)){
echo print_r($file_new_name);
}else{echo "Fail";}

}else{
echo $msg;
}

?>

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...