Upload class finfo_file returns wrong file type - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: Upload class finfo_file returns wrong file type (/showthread.php?tid=63709) |
Upload class finfo_file returns wrong file type - Arcane - 12-01-2015 Hello, Today, I was trying to upload a CVS file using the Upload Class on one of my website and kept getting a filetype error message, although the MIME type of my file (text/csv) was properly configured in the accepted types. After some investigation, I have discovered that the following block of code from the Upload class was returning a wrong MIME type (text/x-c++) : Code: if (function_exists('finfo_file')) Further googleing indicates that finfo_file may return inappropriate mime types. I had no other solution but to disable this method of detection. Any possible workaround? Thanks in advance ! RE: Upload class finfo_file returns wrong file type - skunkbad - 12-01-2015 (12-01-2015, 10:37 AM)Arcane Wrote: Hello, Maybe you mean CSV? A CSV is comma delimited text. I don't know what a CVS is, but maybe that is why you are having problems? File extension is wrong? RE: Upload class finfo_file returns wrong file type - Arcane - 12-01-2015 Yes sorry, CSV is what I meant. |