Welcome Guest, Not a member yet? Register   Sign In
How to upload several images at the same time ???
#1

[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"
        "http://www.w3.org/TR/html4/loose.dtd">
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Bienvenue dans l'Image&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    <h1>Bienvenue dans l'Image des chaussures </h1>
    
    &lt;?php
    
        // here the id_shoes
    
        if(isset($identifiant_chaussure))
        {
            echo 'identifiant:'.$identifiant_chaussure ;
        }
        
          
    ?&gt;
    
    
    
    
              &lt;?php echo form_open_multipart('site/do_upload'); ?&gt;
              
              &lt;?php echo form_label('Identifiant', 'chaussure'); ?&gt;<br/>
             &lt;?php echo form_input('identifiant', $identifiant_chaussure); ?&gt;<br/>
        
        
        
                 &lt;input type="file" name="userfile" size="20" /&gt; <br/>
                
                 &lt;?php echo form_button('ajouter','Ajouter'); ?&gt;
        
                    &lt;?php echo form_submit('envoi', 'Envoyer'); ?&gt;
                    
             &lt;?php echo  form_close(); ?&gt;
    
  
    
&lt;/body&gt;
&lt;/html&gt;

I add a button in order to add other upload form so when we click on it another
&lt;input type="file" name="userfile" size="20" /&gt; <br/>
must show .

Code:
&lt;?php echo form_button('ajouter','Ajouter'); ?&gt;

and my last question how to get after ??
in my controller

Code:
$identifiant_chaussure = $this->input->post('identifiant');
                  
                  
                //  echo ('identifiant '.$identifiant_chaussure) ;  exit ;
                  
                
                $config['upload_path'] = './image/';
  $config['allowed_types'] = 'gif|jpg|png';
  $config['max_size'] = '100';
  $config['max_width']  = '1024';
  $config['max_height']  = '768';
                
                $config['encrypt_name'] = true ;
  
  $this->load->library('upload', $config);

  if ( ! $this->upload->do_upload())
  {
   $error = array('error' => $this->upload->display_errors());
  
   $this->load->view('image_view', $error);
  }
  else
  {
   // $data = array('upload_data' => $this->upload->data());
                        
                        $data = $this->upload->data();
                        
                        
                        
                        // print_r($data);exit ;
  
   $this->load->view('upload_success', $data);

}

thanks


Messages In This Thread
How to upload several images at the same time ??? - by El Forum - 02-23-2012, 08:20 AM
How to upload several images at the same time ??? - by El Forum - 02-23-2012, 02:36 PM
How to upload several images at the same time ??? - by El Forum - 02-23-2012, 04:31 PM
How to upload several images at the same time ??? - by El Forum - 02-24-2012, 12:27 AM
How to upload several images at the same time ??? - by El Forum - 02-24-2012, 01:57 AM
How to upload several images at the same time ??? - by El Forum - 02-24-2012, 03:44 AM
How to upload several images at the same time ??? - by El Forum - 02-24-2012, 10:21 AM
How to upload several images at the same time ??? - by El Forum - 02-24-2012, 08:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB