justinh Posted December 16, 2008 Share Posted December 16, 2008 Having a little trouble getting my upload.php to work. Uploader is in a folder called stbs, also in the stbs folder, is a folder called testing. So i thought this would work: <?php $target_path = "/testing/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)){ echo "The file". basename($_FILES['uploadedfile']['name'])." has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } ?> but this is returning an error of: Warning: move_uploaded_file(/testing/hmmmm.txt) [function.move-uploaded-file]: failed to open stream: No such file or directory in /homepages/29/d119570661/htdocs/wmptest.com/stbs/upload.php on line 7 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpK0nMSR' to '/testing/hmmmm.txt' in /homepages/29/d119570661/htdocs/wmptest.com/stbs/upload.php on line 7 There was an error uploading the file, please try again! hmmm... Link to comment https://forums.phpfreaks.com/topic/137220-file-upload/ Share on other sites More sharing options...
cytech Posted December 16, 2008 Share Posted December 16, 2008 Make sure testing is chmod to 777. Link to comment https://forums.phpfreaks.com/topic/137220-file-upload/#findComment-716806 Share on other sites More sharing options...
justinh Posted December 16, 2008 Author Share Posted December 16, 2008 permission set to 777.. same error Link to comment https://forums.phpfreaks.com/topic/137220-file-upload/#findComment-716809 Share on other sites More sharing options...
justinh Posted December 16, 2008 Author Share Posted December 16, 2008 bump Link to comment https://forums.phpfreaks.com/topic/137220-file-upload/#findComment-716821 Share on other sites More sharing options...
justinh Posted December 16, 2008 Author Share Posted December 16, 2008 nvm fixed it <?php $target_path = "testing/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)){ echo "The file". basename($_FILES['uploadedfile']['name'])." has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } ?> Link to comment https://forums.phpfreaks.com/topic/137220-file-upload/#findComment-716829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.