Answer the question
In order to leave comments, you need to log in
move_uploaded_file false?
Hi all. I am working on linux ubuntu. move_uploaded_file doesn't work for me. How can I fix this.
$file_name = $_FILES['img']['name'];
$file_tmp = $_FILES['img']['tmp_name'];
$img_hash = time()."_".rand(1000, 9999)."_".$file_name;
// move_uploaded_file($_FILES['img']['tmp_name'], $file_name);
if (move_uploaded_file($file_tmp," ../user/user_img/".$img_hash)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Upload failed";
}
Answer the question
In order to leave comments, you need to log in
ini_set('error_reporting',E_ALL);
ini_set('display_errors', 1);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question