Welcome Guest, Not a member yet? Register   Sign In
Specifying an upload destination folder
#3

[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');
// and add:
$config['upload_path'] = './'.$destination_folder;

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/');
// and so on
and set up the values of your dropdown according to the array indexes.


Messages In This Thread
Specifying an upload destination folder - by El Forum - 12-09-2008, 03:26 AM
Specifying an upload destination folder - by El Forum - 12-09-2008, 03:42 AM
Specifying an upload destination folder - by El Forum - 12-09-2008, 03:44 AM
Specifying an upload destination folder - by El Forum - 12-09-2008, 09:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB