do_uploadの前に毎回以下の関数を呼び出します
$this->upload->initialize($upload);
このアレイ内のすべてのファイルを想定します
$ _FILES ['userfile'] ['name']
この場合、スクリプトは次のようになります
$this->load->library('upload');
for ($k = 0; $k < count($_FILES['userfile']['name']); $k++) {
$this->upload->initialize($upload); //must reinitialize to get rid of your bug ( i had it as well)
if (!$this->upload->do_upload('userfile',$k)) {
$this->load->view('upload/image_form', $data + array('error'=>$this->upload->display_errors()));
}
$udata[$k] = $this->upload->data(); //gradually build up upload->data()
}