1
votes

Using Codeigniter 3.1.7

Using the upload class and has allowed types set:

$config['allowed_types'] = "jpg|pdf|doc|docx|xls|xlsx|png|bmp|gif|msg|eml|zip";

Added the mime-type in config/mimes.php:

'msg' => array('text/plain','application/vnd.ms-outlook','application/octet-stream')

PHP reports the filetype I'm testing with as application/octet-stream so that should be sufficient? (IE not a duplicate of question CodeIgniter: "The filetype you are attempting to upload is not allowed." )

What might cause the error?

$this->upload->display_errors() shows:

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

Thanks

1
^ No it's not a duplicate he already tried the answer, @jtherman Can you put some var_dump()s in the is_allowed_filetype()'s method? do it for the following vars: $ext, $this->allowed_types, $this->file_type - Spoody
It is probably wise to upgrade to 3.1.7 any way. - DFriend
I'm using CI v3.1.7, PHP v7.2.1 and Apache 2.4.25 for test described above. Could be server or php version? - DFriend

1 Answers

0
votes

Finally this issue was solved. There was some kind of MIME-issue related to the server configuration in PHP version 7.1.14 - as soon as we updated to 7.2.x on the live server (hosting) the problem was gone. I save this answer here if it might help someone else.