First of all, there are already a lot of (solved) questions regarding this topic. And I tried all possible solutions. But to no avail.
2.1.4
and 2.2.1
.png
,gif
and txt
.mime-type
alterations, eg. by using AddType
in the .htaccess
file5.5
and 5.6
(fileinfo module enabled)mimes.php
filetmp
folder is writableI'm out of options...
Does anybody know what the issue might be?
Thanks in advance!
$this->uploadconfig = array(
'upload_path' => "./tmp/",
'allowed_types' => "png|gif|txt",
'overwrite' => TRUE,
'max_size' => "25000KB",
'max_height' => "5000",
'max_width' => "5000"
);
$this->load->library('upload', $this->uploadconfig);
The filetype you are attempting to upload is not allowed.
[file_name] => test.png
[file_type] => image/png
[file_path] => /CORRECT_SERVER_PATH/tmp/
[full_path] => /CORRECT_SERVER_PATH/tmp/test.png
[raw_name] => test
[orig_name] =>
[client_name] => test.png
[file_ext] => .png
[file_size] => 851
[is_image] => 1
[image_width] =>
[image_height] =>
[image_type] =>
[image_size_str] =>
I found the solution:
Codeigniter 2.1.4
has a bug as described here.
So I've update CI to version 2.2.1
, folowing the update instrucions here and here.
After checking the mimes.php
file for a second time, I noticed a difference between my original file, and the one included in the newer version. I replaced the old one with the newer one, and the problem was solved.
Not documented in the upgrade instructions, is the fact that there is a difference between both files. The older (CI 2.1.4
) of the file returns an array. The newer one (CI 2.2.1
) does not return an array, but sets an array with the variable name $mimes
.