I'm trying upload an image using:
$sourcePath = $_FILES['file']['tmp_name'];
$targetPath = "upload/".$_FILES['file']['name'];
move_uploaded_file($sourcePath,$targetPath) ;
but there is always an error like this:
Warning:move_uploaded_file(upload/13709_965665460118582_8676485775333023105_n.jpg): failed to open stream: No such file or directory in C:\xampp\htdocs\AjaX\ajax_php_file.php on line 23
Warning: move_uploaded_file(): Unable to move 'C:\xampp\tmp\php3C97.tmp' to 'upload/13709_965665460118582_8676485775333023105_n.jpg' in C:\xampp\htdocs\AjaX\ajax_php_file.php on line 23
What am I gonna do with this thing?