kao10324 发表于 2017-6-27 21:22:21

上传图片太大

用教程上的代码如下,但是如果图片超过大小,返回错误,
//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);      }

Hex 发表于 2017-6-28 15:04:00

max_size 这个是大小,字节数,你给一个大点的值,然后还要看 php.ini 的限制是什么,甚至是 nginx 都要看看。
页: [1]
查看完整版本: 上传图片太大