Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Multiple File Uploading
#1

[eluser]saad06[/eluser]
Hi,
I am using codeigniter for multiple file uploading and it is giving me serious problems. The data from the files are coming to my controller. But when I try to run the upload script it gives me error that the
A PHP Error was encountered

Severity: Warning

Message: Illegal offset type in isset or empty

Filename: libraries/Upload.php

Line Number: 147

Also if this error does not occur. Then another error occurs.You did not select file to upload.My multiple uploading script is here. The problem is that the values are coming in the $value variable bur they are not uploading.Please help. Thanks in advance.
Code:
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'].'/images/';
        $config['allowed_types'] = 'gif|jpg|jpeg|png';
        $config['max_size']    = '8024';
        $config['remove_spaces']= TRUE;  
        $config['encrypt_name'] = TRUE;

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

       foreach($_FILES as $key => $value)
        {

          if(isset($value['name']))
            {
                $this->upload->initialize($config);

                if (!$this->upload->do_upload($value['name']))
                {
                  $invalid=$this->upload->display_errors();

                }

                else {

                    $this->upload->data();

                }


             }


        }
#2

[eluser]@incaib[/eluser]
I am viewing your post and mi upload practice that I do yesterday with @codejobs and i find you can test a idea sorry my English here are the code:

Code:
$uploaded_files= $_FILES;
foreach($uploaded_files as $file => $value){

}

i can't test this because i haven't any source for multiple but i read this and view that $file is important and you use $key and i can't view where you make this variable Tongue.

And if you have time for read look this thread for multiple upload that now i find in this forum.

http://ellislab.com/forums/viewthread/207911/

I view is very important in the sentence <input type="file" name="file_1"> that name use file in her name i don't now if this is real but i say you for your interest.

See you and good afternoon a new-bee with codeigniter xD.




Theme © iAndrew 2016 - Forum software by © MyBB