Couldn't get finfo to return the mimetype in the way expected so i made a function to do it with system()
<?php
function get_mime_type($filepath) {
ob_start();
system("file -i -b {$filepath}");
$output = ob_get_clean();
$output = explode("; ",$output);
if ( is_array($output) ) {
$output = $output[0];
}
return $output;
}
?>
hope it works for other people too