Welcome Guest, Not a member yet? Register   Sign In
.doc and .docx file upload
#1

Hi,

Myself Rupam Hazra.I am facing a problem on my project.Whenever i upload a file type .doc,.docx it rendered a error this file type is not valid.I have searched the solution with this issue but feasible solution didn't find.

So i request you that would you give a solution.

Thanks.
Reply
#2

Try adding this to your ./application/config/mimes.php

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

Just add this to the end of them both.

PHP Code:
'application/octet-stream' 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Hi ,

I have modified mimes.php file but still showing type errors.

Thanks.
Reply
#4

Did you check your error log file, it may put the error reason in there.

Some browsers see the mime types different then they are.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(This post was last modified: 11-07-2016, 10:09 PM by rupamhazra.)

Hi,

i have checked the log files and showing same error.I have attached the log file with this reply.Please check.

Attached Files
.php   log-2016-11-08.php (Size: 2.2 KB / Downloads: 138)
Reply
#6

Have you set the allowed file type in the configuration ?

Have a look there Upload Preferences
A good decision is based on knowledge and not on numbers. - Plato

Reply
#7

Yes, Here is my controller code  $config['allowed_types']        = 'gif|jpg|png|doc|pdf|docx';
Reply
#8

@rupamhazra
have you an example doc/docx file and the controller code?



What CI version do you use?
Reply
#9

(This post was last modified: 11-08-2016, 09:37 PM by rupamhazra.)

@ Paradinight

I am using codeigniter 3.0.0 and i have already modified the settings on mimes.php for .doc and .docx as per @InsiteFX
Reply
#10

(11-08-2016, 09:34 PM)rupamhazra Wrote: @ Paradinight

I am using codeigniter 3.0.0 and i have already modified the settings on mimes.php for .doc and .docx as per @InsiteFX

why 3.0.0 and not 3.1.2?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB