1

通过“上传”库上传图片时遇到了一个奇怪的问题。

当我有巨大的照片时,比如 1.8mb 大,它总是把它们倒过来上传。

否则正常上传。

我的上传模型看起来像这样

function do_upload() {

    $this->gallery_path = realpath(APPPATH . '../public/images');

    $config = array(
        'upload_path' => $this->gallery_path,
        'allowed_types' => 'jpg|jpeg|gif|png',
        'max_size' => 2000
    );

    $this->load->library('upload',$config);
    $this->upload->do_upload();
    $image_data = $this->upload->data();

    //to db
    $filename=$image_data['file_name'];

    $this->db->set('name', $filename);
    $this->db->insert('images');

}

谁能解释一下为什么会这样?我试图增加最大尺寸以查看它是否有帮助,但它没有。

非常感谢您的帮助:)

4

1 回答 1

0

尝试设置上传配置:

$config['max_size'] = 0;
于 2012-10-08T11:42:06.817 回答