please use `\OC_Helper::getMimeType()` to determine the mimetype.

https://github.com/owncloud/core/blob/master/lib/helper.php#L392