hassank1 Posted January 11, 2009 Share Posted January 11, 2009 I am trying to upload an image so I set the dir to : $newimage = "/uploads/" . $imagename; however the php consider the root as the C:/ directory so it's saved in C:/uploads/ instead of being saved in c:/wamp/www/my_project_dir/uploads/ Link to comment https://forums.phpfreaks.com/topic/140377-image-upload-directory/ Share on other sites More sharing options...
ILMV Posted January 11, 2009 Share Posted January 11, 2009 You could use the $_SERVER variable 'SCRIPT_FILENAME' to get the script name... $_SERVER['SCRIPT_FILENAME'] The problem is this also includes the file name as well, so you will have to figure out a way of trimming the string to the last slash. ILMV Link to comment https://forums.phpfreaks.com/topic/140377-image-upload-directory/#findComment-734610 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.