PHP를 사용하여 큰 이미지 (> 1.5MB 이상)를 내 웹 사이트에 업로드하려고하지만 파일이 서버에 표시되지 않습니다. 때로는 오류 1 (최대 크기 초과)이 발생합니다.CodeIgniter로 큰 이미지를 업로드 할 때 오류가 발생했습니다.
내가 할 수 있는게 있습니까?
if ($this->input->post('post') == ''){
$type="image";
} else {
$type="image-with-text";
}
} else {
$pic = "";
$type = "text";
}
$result = $this->blog->addPost($_SESSION['user_id'], $type , $this->input->post('post'),$pic);
}
모델 :
function addPost($user_id, $post_type, $post , $pic) {
$today = date("Y-m-d H:i:s");
$vales = array('ev_user_id' => $user_id, 'ev_type' => $post_type, 'ev_text' => $post,'ev_pic' => $pic, 'ev_date' => $today);
$this->db->insert($this->table_name, $vales);
}
오류 :
여기$pic = $this->do_upload('inputUpProfile');
나는 데이터베이스에 사진을 저장 : 여기
public function do_upload($field) {
$config['upload_path'] = './uploads/';
$config['max_size'] = '100000';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if (!$this->upload->do_upload($field)) {
$error = array('error' => $this->upload->display_errors());
return $error;
} else {
/*$data = array('upload_data' => $this->upload->data());
return $data;*/
$updata =$this->upload->data();
$data = $updata['raw_name'].$updata['file_ext'];
return $data;
}
}
내가 함수를 호출 할 수 있습니다
Error Number: 1054
Unknown column 'Array' in 'field list'
INSERT INTO
events
(ev_user_id
,ev_type
,ev_text
,ev_pic
,ev_date
) VALUES (1, 'image', '', Array, '2013-10-02 23:32:50')
당신이 'ev_pic'를 시도 할 수 => $ 그림 [0] :
이 오류는 데이터베이스에있는 그림 값으로이 호출에서 결과를 사용하여 무엇입니까? –