I have a very basic upload script, probably lifted straight off the php.net/move_upload_files function page.
move_uploaded_file() is failed because it canno
move_uploaded_file()
You are using the return value of move_uploaded_file() the wrong way round:
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_file)) { $result['error'] = 'true'; } else { $result['error'] = 'false'; $result['file_loc'] = $upload_file; }