The "filename" needs to be a file that contains a "MIME magic" database. If you want to determine the type of file, you first need to open the MIME database, then ask that database to identify the file.
For instance, if the MIME database is stored in /usr/share/misc/magic.mgc (most Linux distributions store it there), you can do:
// open MIME database
$finfo = finfo_open(FILEINFO_MIME, "/usr/share/misc/magic.mgc");
if (!$finfo)
die("error opening MIME info database");
// print out MIME information of "some-file-name-here"
echo finfo_file($finfo, "some-file-name-here");
finfo_close($finfo);
However, if this is a virtual hosting provider, you might need to copy the magic.mgc file into your public web directory.