[eluser]Corbee[/eluser]
Hi,
I'm doing a file upload, and I needed it to only upload if the user has set a value to the image.
I tried using
Code:
if ($this->input->post('logo'))
{
$config['upload_path'] = './images/CarLogo';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '180';
$config['max_height'] = '180';
$config['overwrite'] = 'TRUE';
$this->load->library('upload', $config);
if(!$this->upload->do_upload('logo'))
{
$this->upload->display_errors();
exit();
}
$logo = $this->upload->data();
if ($logo['file_name'])
{
$logo = $logo['file_name'];
$this->MManage->updatelogo($logo);
}
}
but if you do an echo on the $this->input->post('logo');
you'll realize that it is always blank whether user sets it or not.
What's wrong with my code?
Thanks