I am working in codeigniter framework.I want to upload doc or docx file.So i have write code like this:
$config['upload_path'] = './uploads/resume/';
$config['allowed_types'] = 'docx|doc|DOC|DOCX';
$this->upload->initialize($config);
if ( ! $this->upload->do_upload('resume'))
{
print_r($error = array('error' => $this->upload->display_errors()));
}
else
{
$upload = $this->upload->data();
print_r($upload);exit;
}
Here, it shows and error like The filetype you are attempting to upload is not allowed. And file is not uploaded.
I have also modify mimes.php file and add
'doc' => array('application/msword', 'application/vnd.ms-office'),
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
When I print $this->upload->data() then it shows file_type as application/vnd.oasis.opendocument.text
But, its not working.So how can I upload doc or docx file?