CodeIgniter Forums

Full Version: Inaccurate mime type detection in file uploading class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]aL3xa[/eluser]
I'm having hard times making file uploading class working as I want. First I found a problem with allowed_types config option, and luckily, I found a workaround here. However, if I head over to mimes.php and add custom file extension, such as 'fwf' (stands for fixed width format, which is just a plain textual file) and add 'text/plain' as it's mime type, upon upload I get 'application/octet-stream' in response array field ('file_type').

It's quite certain that I'll need to tweak some functions in upload class. Is there any chance that I can bypass CI mime check and use PECL Fileinfo extension instead? Any suggestions about how to do it properly?