I'm trying to upload image with Jquery and ajax function using codeigniter framework. i can see the error blow:

ساخت وبلاگ

Vote count: 0

A PHP Error was encountered

Severity: Notice

Message: Undefined index: uploadimg

Filename: models/upload_model.php

Line Number: 26

/my code/ Controller

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', ); retu $config;
}

Model

 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' ); retu $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(); }

Please help me...

asked 1 min ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 340 تاريخ : شنبه 29 اسفند 1394 ساعت: 17:11