Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a custom MIME type and override a default extension pattern?

People also ask

What is a MIME type file?

A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications.

Do all files have MIME type?

There are too many issues with MIME types on different operating systems, different applications saving files differently, some files not having a MIME at all, and lastly, the fact that the extension and MIME could be altered by a malicious user or program.


Seems you need to add a magic tag with a priority

<mime-type type="text/stringtemplate">
    <magic priority="50">
        <!-- some match pattern -->
        <!-- <match value="[some characters]" type="string" offset="0" /> -->
    </magic>
    <glob pattern="*.st"/>
</mime-type>