Welcome Guest, Not a member yet? Register   Sign In
Uploading .doc files doesn't work

I'm getting the following error when I try to upload:

"The filetype you are attempting to upload is not allowed.".

Here is my mime for .doc:

'doc' => array('application/msword','application/doc','appl/text','application/vnd.msword','application/word','application/winword','application/vnd.ms-word','application/x-msw6','application/x-msword'),

As you can see I already tried to make up for it by adding more mimes. I have no idea what the problem can be... the file is .doc.

Here is my code:

$sntError = $this->uploadFile($id,'notes','doc|pdf|docx');

private function uploadFile ($id,$input,$extensions) {
$config['allowed_types'] = $extensions;
$config['upload_path'] = './upload/sermon/'. $input;
$config['file_name'] = $input .'-'. $id;
$config['max_size'] = '10000';
$config['overwrite'] = true;
$uploaded = $this->upload->do_upload($input);
$errors = $this->upload->display_errors('<div class="error">', '</div>');
if (!$errors && $uploaded) {
  $fileData = $this->upload->data();
} else {
  return $errors;

[eluser]Rodrigo Alexandre[/eluser]

$config['allowed_types'] = 'doc|docx|pdf';
for example!

I tried coding that in, in your order, and it still didn't work. But that's pretty much already what I had. It has the same error.

Check your ./application/config/mimes.php
'pdf'  => 'application/pdf',
'doc'  => 'application/msword',
'docx' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml',
'docm' => 'application/vnd.ms-word',
'dotm' => 'application/vnd.ms-word',

I did print_r($fileData); to figure out what the .doc file_type was. It was "text/plain," so I added that to my mimes.php and it solved my problem.

Theme © iAndrew 2016 - Forum software by © MyBB