Fancyupload and mime types

Hi all,

I’m using FancyUpload to upload an image on a local MAMP installation.

I’m having trouble getting the right mime type using CFileHelper::getMimeType() as illustrated in the example that goes with the extension. Here’s a few lines from that:


       case 'application/zip':



       case 'image/jpeg':

           $info = @getimagesize($file->getTempName());

            if ($info) {

                $return['width']  = $info[0];

                $return['height'] = $info[1];

                $return['mime']   = $info['mime'];



When uploading an image the mime type comes out as application/octet-stream which is not what I expected, was hoping for image/jpeg.

Does anyone have any idea what’s going on here?


Flash uploaders always send application/octet-stream in the HTTP mimetype.

You can use fileinfo (yii already supports this but you must have the extension installed) to get the uploaded file mimetype.


It is my fault, I should’ve updated the documentation and code for the extension

Try using $file->getName()

Please, see the topic

There are some fixes discussed that could help you for a while

I’ll try to update the extension and docs today.


Hey, guys, I’ve updated the fancyupload extension, please check version 1.3 working samples and instructions file