I have a code in codeigniter which i will store the path of my image in my database. It works fine in inserting but the path is not correct.
My folder name of my upload images are stored in upimages.
The upimages is located in outside of application folder in codeigniter where i created assets/upimages. Here is my path code in inserting to database:
$data = $this->upload->data();
$image_path = $data['full_path'];
$userid = ($this->session->userdata['logged_in']['user_id']);
$imagedb = $this->prof_model->user_img($image_path,$userid);
$status = "success";
$msg = "File successfully uploaded";
Try to make your file path as like as following:
$image_url = base_url().'assets/upimages/'.$data['upload_data']['file_name']; $imagedb = $this->prof_model->user_img($image_url,$userid);