I have this code that i use to upload files on the server. But I get a custom Error produced by else statement,but I need to know the real reason why php is unable to upload the file.
I Get error 2 but I dont get the actual message.
Any suggestions?
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path."/")) {
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} else{
echo "There was an error uploading the file, please try again! ".$_FILES['uploadedfile']['error'];
}
You can try this for actual error occured