add lib.mimemagic package
use mimemagic to detect file type