Perad Posted August 17, 2009 Share Posted August 17, 2009 Hey, why isn't this working? I have also tried using getcwd() with the path, even though the path isn't valid it still doesn't work. Can anyone make any sense out of this? // Upload $path= '/test/upload/job_files/'; $tmpname = $_FILES['docs']['tmp_name']; $to = $path . $_FILES['docs']['name']; move_uploaded_file($tmpname, $to); Errors: Warning: move_uploaded_file(/test/upload/job_files/Brief.doc) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/johndoe/public_html/test/wp-content/plugins/post-jobs.php on line 123 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpBVa9RX' to '/test/upload/job_files/Brief.doc' in /home/johndoe/public_html/test/wp-content/plugins/post-jobs.php on line 123 Link to comment https://forums.phpfreaks.com/topic/170646-file-upload-help/ Share on other sites More sharing options...
deansatch Posted August 17, 2009 Share Posted August 17, 2009 Try this: $path= $_server['DOCUMENT_ROOT'] . '/test/upload/job_files/'; Link to comment https://forums.phpfreaks.com/topic/170646-file-upload-help/#findComment-900040 Share on other sites More sharing options...
Perad Posted August 17, 2009 Author Share Posted August 17, 2009 Hi, nope, no joy. Warning: move_uploaded_file(/home/johndoe/public_html/test/upload/job_files/Brief.doc) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/johndoe/public_html/test/wp-content/plugins/post-jobs.php on line 123 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpIMzrDk' to '/home/johndoe/public_html/test/upload/job_files/Brief.doc' in /home/johndoe/public_html/test/wp-content/plugins/post-jobs.php on line 123 Its bizarre, I really don't get it. Link to comment https://forums.phpfreaks.com/topic/170646-file-upload-help/#findComment-900067 Share on other sites More sharing options...
deansatch Posted August 17, 2009 Share Posted August 17, 2009 Does the directory exist? Does it have correct permissions? Link to comment https://forums.phpfreaks.com/topic/170646-file-upload-help/#findComment-900069 Share on other sites More sharing options...
Perad Posted August 17, 2009 Author Share Posted August 17, 2009 The folder can be found @ domain.com/test/uploads/job_files. What permissions would you recommend, job_files currently has 777 as its permissions. Link to comment https://forums.phpfreaks.com/topic/170646-file-upload-help/#findComment-900099 Share on other sites More sharing options...
deansatch Posted August 18, 2009 Share Posted August 18, 2009 I notice directory is "uploads" and you have "upload" in your code Link to comment https://forums.phpfreaks.com/topic/170646-file-upload-help/#findComment-901103 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.