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 Quote Link to comment 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/'; Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.