Welcome Guest, Not a member yet? Register   Sign In
how to upload multiple file in a single form in codeigniter
#8

[eluser]RaGe10940[/eluser]
Heres a more in depth look at some of my code to further assist any one else looking into doing multiple uploads with a single form field.

as Fuzzy said with one form field just use

Code:
multiple=""

then do :
Code:
$this->load->library('upload'); // Load Library

   $this->upload->initialize(array( // takes an array of initialization options
       "upload_path" => "/usr/local/var/www/Test/ci/uploads/",
       "overwrite" => TRUE,
       "encrypt_name" => TRUE,
       "remove_spaces" => TRUE,
       "allowed_types" => "txt|pdf",
       "max_size" => 300,
       "xss_clean" => FALSE
   )); // These are just my options. Also keep in mind with PDF's YOU MUST TURN OFF xss_clean

   if ($this->upload->do_multi_upload("files")) { // use same as you did in the input field
       $return = $this->upload->get_multi_upload_data(); // then just use function from the extended library

in my case I had to do this for a email system which Fuzzy helped me on so then do this :

Code:
foreach ($return as $file) { // loop over the upload data
    $this->email->attach($file['full_path']); // attach the full path as an email attachments :D
       }

enjoy.


Messages In This Thread
how to upload multiple file in a single form in codeigniter - by El Forum - 04-10-2013, 04:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB