phpcodeigniteruploadify

application/octet-stream mime type issue with codeigniter


I have a strange problem with codeigniter upload class. I use uploadify (http://www.uploadify.com) to add ajax support on file uploading. When the file is sent from uploadify to codeigniter I always get a message that the filetype isn't allowed. I made some research and found out that the cause of the problem is flash, that is used by uploadify. For some reason it always sends files with application/octet-stream mime type. I tried to upload jpg, png, gif file types, but codeigniter always shows that the type is application/octet-stream.

Does anyone know how should I catch the real file type uploaded with flash in codeigneter?


Solution

  • The only solution I've found for this is to add:

    'application/octet-stream'
    

    into the application/config/mimes.php file for the various file types that you require. Not particularly helpful but it's the only effective method found.