I am trying to find the MIME type of a file, but the results I am getting are quite confusing. I am running Ubuntu 8.04.
The file with which I am testing is an OpenOffice writer file. My code is as follows:
Code: Select all
$handle = finfo_open(FILEINFO_MIME);
print(finfo_file($handle,$filename) . "\n");
Code: Select all
application/vnd.oasis.opendocument.textCode: Select all
Hashing magic from /usr/share/mime/magicCode: Select all
$handle = finfo_open(FILEINFO_MIME, '/usr/share/mime/magic');Warning: finfo_open(): Failed to load magic database at '/usr/share/mime/magic'.
Has anyone run across this error before?
Yours sincerely
Rasmus