Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $name_array = array();
- $count = count($_FILES['userfile']['size']);
- foreach ($_FILES as $key => $value)
- for ($s = 0; $s <= $count - 1; $s++) {
- $_FILES['userfile']['name'] = $value['name'][$s];
- $_FILES['userfile']['type'] = $value['type'][$s];
- $_FILES['userfile']['tmp_name'] = $value['tmp_name'][$s];
- $_FILES['userfile']['error'] = $value['error'][$s];
- $_FILES['userfile']['size'] = $value['size'][$s];
- $config['upload_path'] = 'images/equipments/large';
- $config['allowed_types'] = 'gif|jpg|png';
- $this->load->library('upload', $config);
- $this->upload->do_upload();
- $data = $this->upload->data();
- $name_array[] = $data['file_name'];
- $file_src[] = $data['full_path'];
- }
- $this->image_model->add_image($name_array);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement