用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2036|回复: 1
收起左侧

[上传/下载] 上传图片太大

[复制链接]
发表于 2017-6-27 21:22:21 | 显示全部楼层 |阅读模式
用教程上的代码如下,但是如果图片超过大小,返回错误,
//error_reporting(-1);
error_reporting(0);报错开关已关闭,图片不超过大小就正常

An Error Was Encountered
Unable 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);        }

发表于 2017-6-28 15:04:00 | 显示全部楼层
max_size 这个是大小,字节数,你给一个大点的值,然后还要看 php.ini 的限制是什么,甚至是 nginx 都要看看。

本版积分规则