solo per individuare il tipo di file al momento uso questo...
... ovviamente ho lasciato solo i tipi di file che mi possono interessare, ma se avete bisogno aggiungete pure
Codice PHP:
public function getMIMEType($name)
{
preg_match('/\.(.*?)$/', $name, $m); # Get File extension for a better match
switch(strtolower($m[1])){
case 'js': return 'application/javascript';
case 'json': return 'application/json';
case 'jpg': case 'jpeg': case 'jpe': return 'image/jpg';
case 'png': case 'gif': case 'bmp': return 'image/'.strtolower($m[1]);
case 'css': return 'text/css';
case 'xml': return 'application/xml';
case 'html': case 'htm': case 'php': return 'text/html';
case 'xsl': return 'application/xsl+xml';
case 'xslt': return 'application/xslt-xml';
case 'xsd': return 'application/xsd+xml';
case 'zip': return 'application/zip';
case 'swf': return 'application/x-shockwave-flash';
case 'pdf': return 'application/pdf';
case 'doc': return 'application/msword';
case 'rtf': return 'application/rtf';
case 'ppt': return 'application/vnd.ms-powerpoint';
case 'm3u': return 'audio/x-mpegurl';
case 'mov': case 'qt': return 'video/quicktime';
case 'xls': case 'xlt': return 'application/vnd.ms-excel';
case 'mp2': case 'mpa': case 'mpe': case 'mpeg': case 'mpg': case 'mpv2': return 'application/vnd.ms-excel';
default:
if(function_exists('mime_content_type')){ # if mime_content_type exists use it.
$m = mime_content_type($name);
}else if(function_exists('')){ # if Pecl installed use it
$finfo = finfo_open(FILEINFO_MIME);
$m = finfo_file($finfo, $name);
finfo_close($finfo);
}else{ # if nothing left try shell
if(strstr($_SERVER[HTTP_USER_AGENT], 'Windows')){ # Nothing to do on windows
return ''; # Blank mime display most files correctly especially images.
}
if(strstr($_SERVER[HTTP_USER_AGENT], 'Macintosh')){ # Correct output on macs
$m = trim(exec('file -b --mime '.escapeshellarg($name)));
}else{ # Regular unix systems
$m = trim(exec('file -bi '.escapeshellarg($name)));
}
}
$m = split(';', $m);
$this->type = trim($m[0]);
}
}
preso da un commento su php.net e modificato mi pare... fa parte della classe file del framework che sto scrivendo 
potete decidere se dare più peso all'estensione o al mime type e modificarlo di conseguenza
( in effetti in caso di upload forse è meglio controllare prima il mime e poi vedere se coincide con l'estensione... boh fate vobis )