![]() |
Upload class will not allow docx files to be uploaded - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Upload class will not allow docx files to be uploaded (/showthread.php?tid=53243) |
Upload class will not allow docx files to be uploaded - El Forum - 07-16-2012 [eluser]jvk22[/eluser] I can't get the upload class to allow docx files to be uploaded (I fixed the docx problem). I've tried changing the mime types in mimes.php but I still get an error "The filetype you are attempting to upload is not allowed." Code: 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'text/plain'), Code: public function upload_file($team_id) Upload class will not allow docx files to be uploaded - El Forum - 07-18-2012 [eluser]john_j[/eluser] In your mimes.php did you add it as "text/plain"?? Upload class will not allow docx files to be uploaded - El Forum - 07-18-2012 [eluser]jvk22[/eluser] Yes I did but for some reason the codeigniter upload library was reading the mime type a application/zip so I added that to the mime type for docx and that did the trick. Upload class will not allow docx files to be uploaded - El Forum - 04-14-2013 [eluser]Unknown[/eluser] Set docx mime as array and add msword to it: 'docx' => array('application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') Upload class will not allow docx files to be uploaded - El Forum - 04-26-2013 [eluser]beaudierman[/eluser] [quote author="Vitaly Mironenko" date="1366009063"]Set docx mime as array and add msword to it: 'docx' => array('application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')[/quote] Thank you for posting this, I was just having this issue. I found that adding 'application/msword' worked for docx files saved by Windows, but for some reason files saved on Word for Mac weren't working. My solution was to add 'application/zip' as well. Code: 'docx' => array('application/msword', 'application/zip', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'), |