Welcome Guest, Not a member yet? Register   Sign In
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
       }
   }
}




Theme © iAndrew 2016 - Forum software by © MyBB