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 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 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. 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 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"] Link to comment https://forums.phpfreaks.com/topic/190617-simple-directory-questions/#findComment-1005633 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.