我在通过"upload“库上传图片时遇到了一个奇怪的问题。
当我有很大的照片,比如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');
}有没有人能解释一下为什么会变成这样?我试着增加最大大小,看看它是否会有帮助,但没有。
将非常感谢您的一些帮助:)
发布于 2012-10-08 19:42:07
尝试设置您的上传配置:
$config['max_size'] = 0;https://stackoverflow.com/questions/12773639
复制相似问题