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.

 $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;


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


                if (!$this->upload->do_upload($value['name']))


                else {