一個PHP錯誤遇到我想使用codeigniter框架上傳圖像與jquery和ajax函數。我可以看到錯誤的打擊:
嚴重性:通知消息:
未定義指數:uploadimg
文件名:型號/ upload_model.php
行號:26
我的代碼:
控制器
public function do_upload(){
$this->upload->do_upload();
if($this->upload_model->Doupload()){
echo 1;
}else{
echo 0;
}
}
private function set_config_option(){
$config =array(
'allowed_type' => 'gif|jpg|png|jpeg|pdf|doc|xml|zip|rar',
'file_size' => '100',
'max_width' => '1024',
'overwrite' => TRUE,
'max_height' => '768',
);
return $config;
}
型號
private function set_config_option(){
$config =array(
'allowed_type' => 'gif|jpg|png|jpeg|pdf|doc|xml|zip|rar',
'file_size' => '2048000',
'max_width' => '1024',
'overwrite' => TRUE,
'max_height' => '768'
);
return $config;
}
public function Doupload(){
$target_path = 'uploads/';
$target_file = $target_path. basename($_FILES['uploadimg']['name']);
$base_url = base_url();
$img_title = $this->input->post('imgname');
$this->upload->initialize('upload', $this->set_config_option());
// $img = $this->upload->do_upload();
}
請幫我...