用教程上的代码如下,但是如果图片超过大小,返回错误,
//error_reporting(-1);
error_reporting(0);报错开关已关闭,图片不超过大小就正常
An Error Was EncounteredUnable to load the requested language file: language/china/upload_lang.php 以下是教程代码
$config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = 100; $config['max_width'] = 1024; $config['max_height'] = 768; $this->load->library('upload', $config); if ( ! $this->upload->do_upload('userfile')) { $error = array('error' => $this->upload->display_errors()); $this->load->view('upload_form', $error); } else { $data = array('upload_data' => $this->upload->data()); $this->load->view('upload_success', $data); }
|