pete2321 Posted January 5, 2015 Share Posted January 5, 2015 I am using some free code on my website to upload images but having difficulty changing the settings. $destination_folder = './uploads/'; The above file is in /public_html/page/ and saves the pictures to /public_html/page/uploads/ How can I change the destination folder to /public_html/pictures/ I have tried a few obvious things such as '../pictures/' Any ideas?Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/293694-correct-way-to-write-path-for-a-folder/ Share on other sites More sharing options...
Solution Zane Posted January 5, 2015 Solution Share Posted January 5, 2015 If pictures is a directory in your webroot, as your example illustrates, then you can use /pictures Because: / is the root folder (Webroot in your case) ./ is the current folder ../ is the parent folder Also, if you do not put a slash, it is the same as ./ For example, pictures will load from the current directory Quote Link to comment https://forums.phpfreaks.com/topic/293694-correct-way-to-write-path-for-a-folder/#findComment-1501846 Share on other sites More sharing options...
pete2321 Posted January 5, 2015 Author Share Posted January 5, 2015 Thanks for that,I have tried it and it just doesn't seem to want to work when the destination folder isn't in the same folder as the upload page script. The code I'm using is from this tutorial... http://www.sanwebe.com/2012/05/ajax-image-upload-and-resize-with-jquery-and-php Thx Quote Link to comment https://forums.phpfreaks.com/topic/293694-correct-way-to-write-path-for-a-folder/#findComment-1501854 Share on other sites More sharing options...
Zane Posted January 5, 2015 Share Posted January 5, 2015 where is the php image processing script relative to the directory you're trying to upload to? Quote Link to comment https://forums.phpfreaks.com/topic/293694-correct-way-to-write-path-for-a-folder/#findComment-1501857 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.