RyanW67 Posted October 6, 2007 Share Posted October 6, 2007 Dear all, I'm quite a php noobie, have used a tutorial to construct a php image uploader. Though I'm now faced a problem regarding the directory where the image is uploaded to... I have the variable $folder which holds the address of the web folder in which the image is to be uploaded to... However the image will only upload when this variable is set to a folder which is in the same folder as the upload script.... for example I have a secure area/folder called CMS, in this I have the upload file and the upload folder (images), however I don't want to the upload folder to be in the secure area (as it wouldn't allow visitors to see the images) so instead I have tried changing the variable to say $folder = "http://www.myhost.co.uk/images/"; instead of $folder = "http://www.myhost.co.uk/CMS/images/"; (which works fine)... Does this mean I have to upload to wherever my script is? Thanks in advance Ryan Quote Link to comment https://forums.phpfreaks.com/topic/72098-solved-image-upload-directory-problem/ Share on other sites More sharing options...
MasterACE14 Posted October 6, 2007 Share Posted October 6, 2007 yes, you have to upload to where ever your script is, your better off making your secure folder just a normal folder, and make a login script for people to access different folders. Works better, it may take awhile to code, but its much more effective. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/72098-solved-image-upload-directory-problem/#findComment-363390 Share on other sites More sharing options...
Norsk.Firefox Posted October 6, 2007 Share Posted October 6, 2007 No; you don't have to.. But use "../" to get from a folder to another.. Example: the script path: /alfa/beta/upload.php Wanted image path: /alfa/charlie/images/ then you have to set $folder = '../charlie/images/'; ../ means "one directory down" Quote Link to comment https://forums.phpfreaks.com/topic/72098-solved-image-upload-directory-problem/#findComment-363392 Share on other sites More sharing options...
RyanW67 Posted October 6, 2007 Author Share Posted October 6, 2007 Excellent, thank you very much Quote Link to comment https://forums.phpfreaks.com/topic/72098-solved-image-upload-directory-problem/#findComment-363395 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.