[eluser]Wonder Woman[/eluser]
Hi there,
For some reason I get an error when trying to upload a pdf file...can anyone help me?
Code:
// file uploading
$config['upload_path'] = $this->config->item('data_bucket_file_path');
$config['allowed_types'] = 'pdf|doc|docx|ppt|text|txt|jpg|gif';
$this->load->library('upload');
$this->upload->initialize($config);
// do the upload
if(!$this->upload->do_upload()) {
$data['upload_error'] = array('error' => $this->upload->display_errors('<li>', '</li>'));
}
else {
$data['upload_success'] = array('upload_data' => $this->upload->data());
$file_name = $this->upload->file_name;
}
Any help would be great. Thanks.