Multiple File upload doesnot work in CI

Posted by sabuj on Stack Overflow See other posts from Stack Overflow or by sabuj
Published on 2010-04-03T09:36:13Z Indexed on 2010/04/03 9:43 UTC
Read the original article Hit count: 202

Filed under:

Hi I have used Jquery Plugin to upload multiple file with CI. It works fine for one file but if i try to upload more than one file it doesnot work it gives the result like this"menu_back9.pngmenu_back9.png.jpg". function do_upload() { $config['upload_path'] = './uploads/'; // server directory $config['allowed_types'] = 'gif|jpg|png'; // by extension, will check for whether it is an image $config['max_size'] = '1000'; // in kb $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->load->library('upload', $config); $this->load->library('Multi_upload'); $files = $this->multi_upload->go_upload();

    if ( ! $files )        
    {
        $error = array('error' => $this->upload->display_errors());
        $this->load->view('admin/add_digital_product', $error);
    }    
    else
    {
  foreach($files as $file) {
   $pic_name = $file['name'];
   echo $pic_name;
} 

exit; $data = array( 'dg_image_1'=>$picture, 'dgproduct_name'=>$this->input->post('dgproduct_name',TRUE), 'dgproduct_description'=>$this->input->post('dgproduct_description',TRUE), 'url_additional'=>$this->input->post('url_additional',TRUE), 'url_stored'=>$this->input->post('url_stored',TRUE), 'delivery_format'=>$this->input->post('delivery_format',TRUE), 'item_size'=>$this->input->post('item_size',TRUE), 'price'=>$this->input->post('price',TRUE), 'item_code'=>$this->input->post('item_code',TRUE), 'payment_pro_code'=>$this->input->post('payment_pro_code',TRUE), 'delivery_time'=>$this->input->post('delivery_time',TRUE), 'thankyou_message'=>$this->input->post('thankyou_message',TRUE), ); $this->db->insert('sm_digital_product',$data); redirect(site_url().'admin/admins'); } } I used avobe code If any body know please tell me. I am stack there.

© Stack Overflow or respective owner

Related posts about codeigniter