• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to upload two images at same time

#1
[eluser]Sawariya[/eluser]
Hi Friends ,

How to upload two images at same time ... anybody have idea to do..
i am waiting for our replies friends..

Thanks in advance..

#2
[eluser]xwero[/eluser]
For looping through images you have to collect the field names
Code:
$this->load->library('upload'); // always keep it outside loops
$images = array('image1','image2'); // fieldnames
foreach($images as $image)
{
   if($_FILES[$image]['error'] != 4) // images isn't uploaded
   {
       // config options for upload
       $this->upload->initialize($config);
       if(!$this->upload->do_upload($image)
       {
          // error collecting
       }
       else
       {
         // success collecting
       }
   }
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.