How to upload several images at the same time ??? |
[eluser]ludo31[/eluser]
hello , I would like to know how to upload several images at the same time , I know for one image and I can store it in database !! but my project is about shoes : each chose have identifier (id_chaussure ) and we can attach it several images : so here is my viex file where we download image Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" I add a button in order to add other upload form so when we click on it another <input type="file" name="userfile" size="20" /> <br/> must show . Code: <?php echo form_button('ajouter','Ajouter'); ?> and my last question how to get after ?? in my controller Code: $identifiant_chaussure = $this->input->post('identifiant'); thanks
[eluser]pickupman[/eluser]
You just create two file inputs, and check for them. Code: //View
[eluser]pbflash[/eluser]
You could also create multiple upload inputs like this: Code: <input type="file" name="userfile[]" size="20" />
[eluser]Jason Stanley[/eluser]
You can also use the 'multiple' attribute on the file input tag. However this doesn't work on Internet Explorer. The other option is to use something like swfupload. However this requires flash to run.
[eluser]ludo31[/eluser]
Hello , I think the problem is the libraries/Upload.php , it doesn't accept userfile as an array I mean when I try in view : Code: <form action="http://localhost/CodeIgniter3/index.php/site/do_upload" method="post" accept-charset="utf-8" enctype="multipart/form-data"> Code: function do_upload() $data result Code: array but when we change : Code: <input type="file" name="userfile[]" size="20" /> <br/> Code: A PHP Error was encountered that 's all
[eluser]Mauricio de Abreu Antunes[/eluser]
Create your own lib. There are several ways to create your own lib, managing your upload error in your way.
[eluser]ludo31[/eluser]
may be the solution is here http://www.mitesdesign.com/blog/tag/code-igniter
[eluser]pbflash[/eluser]
I haven't tried uploading multiple images with CI yet. It sounds like the upload library will only accept one file at a time. You may need to create your own library to handle multiple uploads. |
Welcome Guest, Not a member yet? Register Sign In |