Welcome Guest, Not a member yet? Register   Sign In
Multiple file upload
#2

[eluser]xwero[/eluser]
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();
        }
}
// do something with the errors and/or uploads array
You could even use the $_FILES[$field]['error'] as a first error check


Messages In This Thread
Multiple file upload - by El Forum - 11-28-2007, 02:44 AM
Multiple file upload - by El Forum - 11-28-2007, 03:32 AM
Multiple file upload - by El Forum - 11-28-2007, 06:05 AM
Multiple file upload - by El Forum - 12-08-2007, 02:40 PM
Multiple file upload - by El Forum - 12-08-2007, 05:34 PM
Multiple file upload - by El Forum - 12-08-2007, 06:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB