CodeIgniter Forums
upload multiple codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: upload multiple codeigniter (/showthread.php?tid=60943)



upload multiple codeigniter - El Forum - 08-06-2014

[eluser]Unknown[/eluser]
Morning Developers.

Has anyone had to do multiple Upload with codeigniter? using the 'multiple' attribute in the input file type I can select more than one image file, but when I submit the form the codeigniter identifies a single image:

Controller :
`
$config['upload_path'] = FCPATH . '/assets/imagens/foto_galeria/';
$config['allowed_types'] = 'gif|jpg|png';
$this->upload->initialize($config);
$this->upload->do_upload($campo);
$this->upload->data();
`

View:

`
echo '<div class="form-group">';
echo form_label('Imagem', 'imagem');
echo form_upload(array('name' => 'imagem', 'class' => 'form-control form-file' , 'multiple'=>true), set_value('imagem'));
echo '</div>';
`

Does anyone know how to make codeigniter read more than one image on the same input file?


upload multiple codeigniter - El Forum - 08-06-2014

[eluser]CroNiX[/eluser]
It was only designed for single file upload. I just use the traditional form methods and directly use the $_FILES superglobal and don't use CI's methods where I need it.

There are other answers if you search the forum.


upload multiple codeigniter - El Forum - 08-10-2014

[eluser]www.sblog.in[/eluser]
Example here http://www.webtuts.in/codeigniter-multiple-files-upload/