CodeIgniter Forums

Full Version: upload multiple codeigniter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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?

El Forum

[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.

El Forum

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