Currently have these code.
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '1000';
$config['max_width'] = '270';
$config['max_height'] = '280';
$this->load->library('upload', $config);
Then ill insert the details into the database.
$this->Model->upload_image($this->upload->data(),$result_id);
But the db row is empty so i checked myself. I print_r($image_data) which is the first parameter of the model function. Still empty, to make sure even mor. i typed in.
print_r($this->upload->data());
Still, the results come out empty.
Array ( [file_name] => [file_type] => [file_path] => ./uploads/ [full_path] => ./uploads/ [raw_name] => [orig_name] => [client_name] => [file_ext] => [file_size] => [is_image] => [image_width] => [image_height] => [image_type] => [image_size_str] => )
EDIT:
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('view', $error);
}
else
{
$image_data = array('upload_data' => $this->upload->data());
print_r($this->upload->data());
}
$this->upload->do_upload()?