SocomNegotiator Posted February 2, 2010 Share Posted February 2, 2010 I am trying to upload a file to a certain folder in my directory. However, the folder I want is not in the same folder as the file. This is what I have...Do I have the correct path? move_uploaded_file($_FILES["file"]["tmp_name"], "../files/hotsheet/" . $_FILES["file"]["name"]); echo "Stored in: " . "../files/hotsheet/" . $_FILES["file"]["name"]; Here is an example of my folder setup /html/ /files/ /hotsheet/ /sources/ file.php Quote Link to comment https://forums.phpfreaks.com/topic/190617-simple-directory-questions/ Share on other sites More sharing options...
teamatomic Posted February 2, 2010 Share Posted February 2, 2010 that depends. It is correct if the script is in /files. try ../../hotsheet HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/190617-simple-directory-questions/#findComment-1005303 Share on other sites More sharing options...
SocomNegotiator Posted February 2, 2010 Author Share Posted February 2, 2010 Sorry I did not specify...the script is in the sources folder, and I want the uploaded file to go to the hotsheet folder, which is in the files folder. Quote Link to comment https://forums.phpfreaks.com/topic/190617-simple-directory-questions/#findComment-1005549 Share on other sites More sharing options...
teamatomic Posted February 2, 2010 Share Posted February 2, 2010 Yes, I got that from your post. The answer remains the same. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/190617-simple-directory-questions/#findComment-1005605 Share on other sites More sharing options...
wildteen88 Posted February 2, 2010 Share Posted February 2, 2010 Is the /html/ folder your websites root folder? You could use the following as the path $_SERVER['DOCUMENT_ROOT'] . '/files/hotsheet/' . $_FILES["file"]["name"] Quote Link to comment https://forums.phpfreaks.com/topic/190617-simple-directory-questions/#findComment-1005633 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.