Mój widok
model
//upload files function make_upload($my_file, $types, $resize) { $this->load->library('upload'); 'allowed_types' => $types, //'jpg|jpeg|gif|png', 'upload_path' => './img/uploads/media_library', //$this->gallery_path, 'overwrite' => true, 'max_size' => 0 ); $this->upload->initialize($config); if(! $this->upload->do_upload($my_file)) { } $image_data = $this->upload->data(); if($resize == 1) { 'source_image' => $image_data['full_path'], 'new_image' => './img/uploads/media_library/thumbs', //'maintain_ratio' => true, 'width' => 90, 'height' => 90 ); $this->load->library('image_lib', $config); $this->image_lib->resize(); } //return $image_data['file_name']; }
controller
$this->load->model('file_model'); //var_dump($_FILES); foreach( $_FILES['pro_image']['name'] as $key => $image_name ) { $this->file_model->make_upload($key, 'jpg|gif|png|jpeg', 1); }
i dostaję komunikat "You did not select a file to upload."
metoda do_upload() jako parametr ma dostać name inputa, na wiele sposobów konstruowałem już pętle
Oczywiście jak szybko przerobiłem to na bez multiple ( nazwa inputa samo pro_image ) chodzi
Co tu jest nie tak?