Mime型;应用程序/CDFV2损坏”;用于使用PHP的Outlook消息文件';s finfo_file


Mime type "application/CDFV2-corrupt" for Outlook msg file using PHP's finfo_file

我对Outlook msg文件做了一些研究,我希望mime类型是application/vnd.ms-outlook。但是当我使用finfo_file()时,我得到了application/CDFV2-corrupt。从那以后,我在两个不同的服务器上尝试了它(我的本地Centos盒子和我的Centos VPS),得到了相同的结果。有人试过这个代码吗?你得到的结果和我一样吗?如何使用PHP获取msg文件的mime类型?

<?php
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$filetype=finfo_file($finfo, 'test.msg');
echo($filetype);
?>

输出:

application/CDFV2-corrupt

尝试application/octet-stream。只要文件扩展名正确(.MSG),Outlook就可以很好地打开MSG文件。