Specifying an upload destination 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: Specifying an upload destination folder (/showthread.php?tid=13861) |
Specifying an upload destination folder - El Forum - 12-09-2008 [eluser]phpserver[/eluser] I have been trying to make a script that allows me to specify a folder in which to upload my files(choose a destination folder in the view).I have tried all of my tricks and i cannot seem to get it right.Anybody?. Specifying an upload destination folder - El Forum - 12-09-2008 [eluser]xwero[/eluser] have you tried the move_uploaded_file function? Specifying an upload destination folder - El Forum - 12-09-2008 [eluser]LuckyFella73[/eluser] hi phpserver, after calling the do_upload function you can define the upload folder by: Code: $config['upload_path'] = './your_upload_folder/'; In your view you can place a dropdown and set the values regarding to the folder names you want to switch between (related to your root folder). Just catch the dropdown value after calling the do_upload function like this: Code: $destination_folder = $this->input->post('name_of_select_tag'); That should work at least if you hav only one level. In case you need more folder levels you could set up an array with all your possible folder structure destinations like Code: $upload_folders = ('uploads/folder1','uploads/folder2','uploads/folder1/images/'); Specifying an upload destination folder - El Forum - 12-09-2008 [eluser]phpserver[/eluser] Thanks luckyfella,it works perfectly. |