Welcome Guest, Not a member yet? Register   Sign In
CI 1.7 multi file upload. Possible?
#1

I've been trying to do a multi file upload with codeigniter 1.7. I'm having issues to say the least!
I know its an old version but thats what ive got to work with.
Can I loop the $_FILES array and upload each one? It doesnt seem to work.
Heres what ive got?
Code:
       $dir_name = $this->input->post('dir');

   $file_path = "./system/application/views/courses/course/";

   $full_file_path = $file_path . $dir_name;


   if (!file_exists($full_file_path)) {
       mkdir($full_file_path, 0777, true);
   }

   $config['upload_path'] = $full_file_path;
   $config['allowed_types'] = 'php|js|html';

   $this->load->library('upload');

   foreach ($_FILES as $files => $fileObject)  //
   {
       if (!empty($fileObject['name']))
       {
           $this->upload->initialize($config);
           if (!$this->upload->do_upload($files))
           {
               $errors = $this->upload->display_errors();
           }
           else
           {
               echo "It worked";
           }
       }
   }
Is this posssible?
This code runs but doesnt upload the files?!
Reply


Messages In This Thread
CI 1.7 multi file upload. Possible? - by frobak - 01-12-2016, 07:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB