• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload .doc files

#1
I can't upload .doc files .

Controller 

Code:
       $config['upload_path']          = './assets/uploads/atasamente/';
       $config['allowed_types']        = 'txt|xls|xlsx|doc|docx|pdf';
       $config['max_size']             = 10000;

        $this->load->library('upload', $config);

When trying to add a .doc file i get 

Code:
The filetype you are attempting to upload is not allowed.

Any info on this ?
Reply

#2
Modify \application\config\mimes.php

Code:
    'doc'    =>    array('application/msword', 'application/vnd.ms-office'),
    'docx'    =>    array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
Reply

#3
I have tried that with no luck Sad
Reply

#4
(11-24-2014, 06:32 AM)GrigoreMihai Wrote: I have tried that with no luck Sad

Hi, try this:

Code:
echo mime_content_type('path_to_the_file');

Then must add in mimes.php the results for your extension.
Reply

#5
Try this one:

Code:
'docx'  =>  array('application/vnd.openxmlformats-officedocument.wordprocessingml.document','application/octet-stream','application/x-zip-compressed'),

or this ones

'doc'   =>  'application/msword',
'docx'  =>  array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
'xlsx'  =>  array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'),
'word'  =>  array('application/msword', 'application/octet-stream'),

Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.