This script won't work, but I have no idea why: if(isset($_FILES["uploadedfile"])){ // upload file //--------------------------------------------------------------------------- $target_path = "uploads/Signature"; if(!is_dir($target_path)){ mkdir($target_path, 0755); chmod($target_path, 0777); } else chmod($target_path, 0777); $target_path .= "/" . basename( $_FILES['uploadedfile']['name']); if(!move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { print_r($_FILES); die("problem uploading file"); } } It only prints out the following: Array ( [uploadedfile] => Array ( [name] => RavgonLogoSmall.gif [type] => image/gif [tmp_name] => C:\WINDOWS\Temp\phpB46A.tmp [error] => 0 [size] => 8175 ) ) problem uploading file Any ideas? can anyone help?
Try the following code, you can whether the directory is writable or not if(is_writable ( $target_path )) { echo "Upload directory is writable"; } else { echo "Upload directory is not writable"; }
I tried using the is_writable function and the result is that the folder is writable. So it's not that. Anything wrong with the PHP? I tried eliminating the basename function and that didn't change anything either.
ok I figured it out. I used this code to discover the error: $errors= error_get_last(); echo "COPY ERROR: ".$errors['type'] . "<br/>"; echo "<br />\n".$errors['message'] . "<br/>"; This revealed an open stream error - permission denied. So b/c I couldn't really change the folder permissions, I switched folders to another folder on another disc and it works fine. Silly mistake.