phpnoobie9 Posted March 6, 2008 Share Posted March 6, 2008 I've chmod the test folder to 777 I'm on centos 5 with cpanel. Line 20: if (move_uploaded_file ($_FILES['thefile']['tmp_... "/test/{$_FILES['thefile'... Warning: move_uploaded_file(/test/... [function.move-uploaded-f... failed to open stream: No such file or directory in /home/testsite/public_htm... on line 20 Warning: move_uploaded_file() [function.move-uploaded-f... Unable to move '/tmp/php6fLecj' to '/test/1.gif' in /home/testsite/public_htm... on line 20 Link to comment https://forums.phpfreaks.com/topic/94807-failed-to-open-streamfor-file-upload/ Share on other sites More sharing options...
awpti Posted March 6, 2008 Share Posted March 6, 2008 You probably want to use something like this: if (move_uploaded_file ($_FILES['thefile']['tmp_... , $_SERVER['DOCUMENT_ROOT']."/test/{$_FILES['thefile'... Link to comment https://forums.phpfreaks.com/topic/94807-failed-to-open-streamfor-file-upload/#findComment-485579 Share on other sites More sharing options...
phpnoobie9 Posted March 7, 2008 Author Share Posted March 7, 2008 Found out that I needed to add the absolute path instead of just the '/test/' Fixed that and now it's working. Thanks. Link to comment https://forums.phpfreaks.com/topic/94807-failed-to-open-streamfor-file-upload/#findComment-485608 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.