Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. $name_array = array();
  2. $count = count($_FILES['userfile']['size']);
  3. foreach ($_FILES as $key => $value)
  4. for ($s = 0; $s <= $count - 1; $s++) {
  5. $_FILES['userfile']['name'] = $value['name'][$s];
  6. $_FILES['userfile']['type'] = $value['type'][$s];
  7. $_FILES['userfile']['tmp_name'] = $value['tmp_name'][$s];
  8. $_FILES['userfile']['error'] = $value['error'][$s];
  9. $_FILES['userfile']['size'] = $value['size'][$s];
  10. $config['upload_path'] = 'images/equipments/large';
  11. $config['allowed_types'] = 'gif|jpg|png';
  12. $this->load->library('upload', $config);
  13. $this->upload->do_upload();
  14. $data = $this->upload->data();
  15. $name_array[] = $data['file_name'];
  16. $file_src[] = $data['full_path'];
  17.  
  18. }
  19.  
  20. $this->image_model->add_image($name_array);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement