[eluser]Wonder Woman[/eluser]
Hi,
I have a problem with my code and I would be really grateful if someone could help me resolve it please.
Basically, when I try and upload an image it says that I have not selected a file, when I know I have. Whilst I want this fixed I was also wondering if you know how I can upload this one file to two different folders?
Controller:
Code:
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'].'/website/uploads/';
$config['allowed_types'] = 'gif|jpg|png|bmp|jpeg|pdf|doc';
$config['max_size'] = 200;
$this->load->library('upload');
$this->upload->initialize($config);
if(!$this->upload->do_upload())
{
$data['upload_errors'] = array('error' => $this->upload->display_errors());
}
else {
$data['upload_data'] = array('upload_data' => $this->upload->data());
}
View:
Code:
echo '<p>'.form_upload('file_name', 'Upload').'</p>';
If you could help me that would be great, many thanks in advance.