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:
switch(CFileHelper::getMimeType($file->getTempName())){
case 'application/zip':
break;
case 'image/jpeg':
$info = @getimagesize($file->getTempName());
if ($info) {
$return['width'] = $info[0];
$return['height'] = $info[1];
$return['mime'] = $info['mime'];
}
break;
When uploading an image the mime type comes out as application/octet-stream which is not what I expected, was hoping for image/jpeg.