I've been trying to get this to work and upload the file but it's not working!! $target_path = "/upload_logo"; if(move_uploaded_file($_FILES['company_logo']['tmp_name'], $target_path)) { echo "done"; } PHP: HELPPP!!!
Put this line before your code, and see what it tells you: if ($_FILES["company_logo"]["error"] > 0) { echo "Return Code: " . $_FILES["company_logo"]["error"] . "<br />"; switch ($_FILES['company_logo']['error']){ case 1: echo 'The File is too Big.<br />PHP Installation Max File Size Error<br />'; case 2: echo 'The File is too Big.<br />Form Specified Max File Size Error<br />'; case 3: echo 'Only Part of the File was Uploaded.<br />'; case 4: echo 'No File was Uploaded.<br />'; case 6: echo "Missing a Temporary Folder.<br />"; case 7: echo "Failed to Write File to Disk.<br />"; case 8: echo "File Upload Stopped By Wrong Extension.<br />"; } } PHP:
$target_path = "upload_logo/"; $target_path = $target_path . basename( $_FILES['company_logo']['name']); if(move_uploaded_file($_FILES['company_logo']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['company_logo']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } PHP:
i think this code is right , you can try it . if you still got problem don't worry just reply this thread again , i will help you