All Projects → erlangpack → mimetypes

erlangpack / mimetypes

Licence: other
Erlang MIME types library

Programming Languages

erlang
1774 projects
elixir
2628 projects
Makefile
30231 projects

Projects that are alternatives of or similar to mimetypes

Mime Db
Media Type Database
Stars: ✭ 612 (+694.81%)
Mutual labels:  mime-types
Swime
🗂 Swift MIME type checking based on magic bytes
Stars: ✭ 119 (+54.55%)
Mutual labels:  mime-types
mimer
A simple Mime type getter
Stars: ✭ 15 (-80.52%)
Mutual labels:  mime-types
Mime Types
The ultimate javascript content-type utility.
Stars: ✭ 865 (+1023.38%)
Mutual labels:  mime-types
Filetype
Fast, dependency-free, small Go package to infer the binary file type based on the magic numbers signature
Stars: ✭ 1,278 (+1559.74%)
Mutual labels:  mime-types
Fileio.jl
Main Package for IO, loading all different kind of files
Stars: ✭ 133 (+72.73%)
Mutual labels:  mime-types
Ruby Mime Types
Ruby MIME type registry library
Stars: ✭ 288 (+274.03%)
Mutual labels:  mime-types
MimeTypesMap
Simple dictionary provides a few methods to lookup mime type/extension, generated From Apache's mime.types.
Stars: ✭ 25 (-67.53%)
Mutual labels:  mime-types
Mime
The Hoa\Mime library.
Stars: ✭ 100 (+29.87%)
Mutual labels:  mime-types
php-mimetyper
PHP mime type and extension mapping library: built with jshttp/mime-db, compatible with Symfony and Laravel
Stars: ✭ 21 (-72.73%)
Mutual labels:  mime-types
Sixarm ruby magic number type
SixArm.com » Ruby » MagicNumberType infers a data type from the data's leading bytes
Stars: ✭ 13 (-83.12%)
Mutual labels:  mime-types
Mog
A different take on the UNIX tool cat
Stars: ✭ 62 (-19.48%)
Mutual labels:  mime-types
Yagmail
Send email in Python conveniently for gmail using yagmail
Stars: ✭ 2,169 (+2716.88%)
Mutual labels:  mime-types
Mime
Shared MIME-info database in D programming language
Stars: ✭ 7 (-90.91%)
Mutual labels:  mime-types
khudro
Khudro is a very light weight web-server built with C.
Stars: ✭ 19 (-75.32%)
Mutual labels:  mime-types
Mimetype
A fast golang library for MIME type and file extension detection, based on magic numbers
Stars: ✭ 452 (+487.01%)
Mutual labels:  mime-types
Apaxy
a simple, customisable theme for your apache directory listing
Stars: ✭ 1,672 (+2071.43%)
Mutual labels:  mime-types
transmat
Share data beyond the browser boundaries. Enable users to transfer data to external apps, and open your webapp to receive external data.
Stars: ✭ 453 (+488.31%)
Mutual labels:  mime-types
CommonCrawlDocumentDownload
A small tool which uses the CommonCrawl URL Index to download documents with certain file types or mime-types. This is used for mass-testing of frameworks like Apache POI and Apache Tika
Stars: ✭ 43 (-44.16%)
Mutual labels:  mime-types
mimesniff
MIME Sniffing Standard
Stars: ✭ 89 (+15.58%)
Mutual labels:  mime-types

mimetypes

Test Hex pm

mimetypes is an Erlang library to fetch MIME extension/name mappings.

Usage

1> application:start(mimetypes).
ok
2> mimetypes:extension(<<"js">>).
<<"application/javascript">>
3> mimetypes:extension(<<"mb">>).
<<"application/mathematica">>
4> mimetypes:extension(<<"html">>).
<<"text/html">>
5> mimetypes:extension(<<"m3u8">>).    
[<<"application/vnd.apple.mpegurl">>,
 <<"application/x-mpegurl">>]
6> mimetypes:filename("/a/b.js").
<<"application/javascript">>
7> mimetypes:extensions(<<"application/mathematica">>).
[<<"ma">>,<<"nb">>,<<"mb">>]

Additional types

Additional mappings can be loaded at runtime using the mimetypes:load/2 function. If this function is timing out it is possible to increase the timeout using mimetypes:load/3.

1> application:start(mimetypes).
ok
2> mimetypes:load(default, [{<<"ext">>, <<"new/type">>}]).
ok
3> mimetypes:extension(<<"ext">>).
[<<"application/vnd.novadigm.ext">>,<<"new/type">>]
2> mimetypes:load(default, [{<<"ext">>, <<"new/type">>}], 10000).
ok

Additional mappings can also be specified using the application environment variables for the mimetypes application. These can be added to the config file specified using the erl -config flag.

[{mimetypes, [
    %% Wait for all additional types to be loaded before returning from
    %% application:start(mimetypes). Set to false to return immidiately
    %% and load them in the background.
    {load_async, true},
    %% Timeout to use for calls to mimetypes:load/3 while loading additional
    %% mimetypes. The default is the same as for mimetypes:load/2. You may
    %% need to increase this value.
    {load_timeout, 5000},
    {load, [
        {default, [
            {<<"ext">>, <<"new/type">>}
        ]}
    ]}
]}].
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].