开发者

Codeigniter - Fatal error

I have this error, Fatal error: Call to undefined method CI_Input::file() in D:\xampp\htdocs\application\controllers\page.php on line 219 and use from Multiple Uploads with JQuery and Code Igniter and Extended Input for Files

This is my code:

if($this->input->file('userfile')){ //This is line 219
    $config['upload_path'] = './uploads/'; 
    $config['allowed_types'] = 'gif|jpg|png'; 
    $config['max_size']    = '1000'; 
    $config['max_width']  = '1024';
    $config['max_height']  = '768';

    $this->upload->initialize($config);
    $this->load->library('Multi_upload');

    $files = $this->multi_upload->go_upload();
    //var_dump($files);
    if ( ! $files )
    {
        $error = $this->upload->display_errors();                           
        echo $error;
        return false;
    }
    else
    {
        $data3 = array();
        foreach ($files as $idx => $name) {
            //var_dump($name['name']);
            $data3[] = array(
                'relation' => $id_residence,
                'images' => $name['name'],
            );
        };
        $data333 = $this->db->i开发者_如何学编程nsert_batch('hotel_image', $data3);
    }
}


Instead of isset()

try:

$myInput = $this->input->file('userfile');
if(!empty($myInput)){
    ...
    ...
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜