1

How can I validate two inputs using the CodeIgniter's File Upload Library?

I have two inputs

<input type="file" name="cover">
<input type="file" name="images[]" multiple>

I did try this one

if( ! $this->upload->do_upload('cover') || ! $this->upload->do_upload('images[]') ) {
    die($this->upload->display_errors());

} else {
    var_dump($this->upload->data('file_name'));die();

} 

...but it always displays "You did not select a file to upload."

  • These may help http://stackoverflow.com/questions/11524356/multiple-files-upload-array-with-codeigniter-2-0 http://stackoverflow.com/questions/19317418/how-to-upload-multiple-images-using-codeigniter –  Jan 15 '17 at 20:47
  • Hi! Thanks for the links! I already read them but I don't think we have the same scenario. What I have is a different inputs with different names, one is a single input file and the other is multiple. Im not sure tho, Im new to CodeIgniter. But thanks for the help! :) – Dunkin Donato Jan 16 '17 at 10:26

0 Answers0