Welcome Guest, Not a member yet? Register   Sign In
uploading multiple files to different folders
#1

[eluser]A.M.F[/eluser]
hello guys,

i am working on file uploading for my control panel.
i have set a multipe file uploading that looks like that-
Code:
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size']    = '100';
$config['max_width']  = '1024';
$config['max_height']  = '768';
        
$this->load->library('upload', $config);

$keys = array_keys($_FILES);
$errors = array();
$uploads = array();

foreach($keys as $field){
    
        if ( ! $this->upload->do_upload($field))
        {
            $errors[] = $this->upload->display_errors();
        }    
        else
        {
            $uploads = $this->upload->data();
        }
}
(credit to xwero)

but in here, all the files goes to the same path: uploads.
how can i config a different upload_path for each file before calling the library?
i can't do it with an if statment, cuz i am uploading the files from the same form.

what can i do?


Messages In This Thread
uploading multiple files to different folders - by El Forum - 11-29-2007, 03:35 AM
uploading multiple files to different folders - by El Forum - 11-29-2007, 03:48 AM
uploading multiple files to different folders - by El Forum - 11-29-2007, 03:53 AM
uploading multiple files to different folders - by El Forum - 11-29-2007, 04:02 AM
uploading multiple files to different folders - by El Forum - 11-29-2007, 04:18 AM
uploading multiple files to different folders - by El Forum - 11-29-2007, 04:38 AM
uploading multiple files to different folders - by El Forum - 11-29-2007, 02:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB