wangchao/mime-type-sniffer

a php mime type sniffer inspired by chrome cpp code

v0.0.2 2021-05-04 09:00 UTC

This package is auto-updated.

Last update: 2024-09-26 12:22:14 UTC


README

一个把Chrome浏览器的C++ MimeType检测代码, 移植到php里,

Chrome的源C++代码地址是: https://github.com/chromium/chromium/blob/9deef45cc5f77319506088554cd40aa521e9df8d/net/base/mime_sniffer.cc

使用方式

$mimeTypeResult = 
    (new MimeTypeSniffer())
        ->sniff($fileFullPath, $fileOriginalName);

echo $mimeTypeResult;