uploading files outside the root folder - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: uploading files outside the root folder (/showthread.php?tid=40592) |
uploading files outside the root folder - El Forum - 04-13-2011 [eluser]ebuoe[/eluser] hello everyone ... below is a sample of code i use for uploading images to a gallery in my application ... just for improved secirity i decided that i should upload the files to another folder outside my root directory ... anoda folder in my www .... i specified the full file path to the directory where it should uploaad to but that is where the error started .... it did not work ... would appreciate it if sum1 helped me with this Code: if($this->form_validation->run()==FALSE) uploading files outside the root folder - El Forum - 04-13-2011 [eluser]InsiteFX[/eluser] You can try this, but you may also need to give it the full url path. Code: $dir = "../gallery/safe/"; Also make sure you have your permissions set right for the folder! InsiteFX uploading files outside the root folder - El Forum - 04-13-2011 [eluser]ebuoe[/eluser] i use $dir="../gallery/safe/"; for uploading within the website folder it works perfectly well ... but what i want to do now is to upload outside the root folder and it is not working uploading files outside the root folder - El Forum - 04-13-2011 [eluser]InsiteFX[/eluser] Directory handling is very easy for each directoy you want to move up ../ so Try this, just keep adding ../ until you get where you want to go. Code: $dir = "../../gallery/safe/"; InsiteFX uploading files outside the root folder - El Forum - 04-13-2011 [eluser]ebuoe[/eluser] thanks a lot uploading files outside the root folder - El Forum - 04-13-2011 [eluser]InsiteFX[/eluser] Your very Welcome! |