04-07-2016, 07:12 AM
Hi,
I am trying to understand the uploader. I have a uploader.php with the config in and it does work if I break the code inside it, so I know its being loaded.
I have this process at the moment and it works and adds the bit to the database but its not uploading the image.
I feel i am not using it right but I have looked at the docs and I cannot see any issue.
Thanks,
Doomie
I am trying to understand the uploader. I have a uploader.php with the config in and it does work if I break the code inside it, so I know its being loaded.
I have this process at the moment and it works and adds the bit to the database but its not uploading the image.
PHP Code:
public function upload_image_process(){
$upload_image = $this->input->post('upload_image');
$data = array(
'name' => $this->input->post('image_name')
);
if (is_array($data) && count($data)>0){
$this->upload->do_upload($upload_image);
$this->Admin_model->add_content($data, 'image_uploads');
$this->session->set_flashdata('message', 'Image uploaded.');
redirect('admin/dashboard');
} else {
redirect('admin/dashboard');
}
}
I feel i am not using it right but I have looked at the docs and I cannot see any issue.
Thanks,
Doomie