Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robrwo/media-types-simple
Media-Types-Simple
https://github.com/robrwo/media-types-simple
Last synced: 11 days ago
JSON representation
Media-Types-Simple
- Host: GitHub
- URL: https://github.com/robrwo/media-types-simple
- Owner: robrwo
- Created: 2014-06-04T21:30:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-20T18:19:08.000Z (almost 10 years ago)
- Last Synced: 2024-10-11T21:56:34.649Z (about 1 month ago)
- Language: Perl
- Size: 325 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
NAME
Media::Type::Simple - MIME Types and their file extensionsREQUIREMENTS
The following non-core modules are required:Exporter::Lite
File::Share
File::ShareDirSYNOPSIS
use Media::Type::Simple;$type = type_from_ext("jpg"); # returns "image/jpeg"
$ext = ext_from_type("text/plain"); # returns "txt"
DESCRIPTION
This package gives a simple functions for obtaining common file
extensions from media types, and from obtaining media types from file
extensions.It is also relaxed with respect to having multiple media types
associated with a file extension, or multiple extensions associated with
a media type, and it includes media types for encodings such as `gzip'.
It is defined this way in the default data, but this does not meet your
needs, then you can have it use a system file (e.g. /etc/mime.types) or
custom data.By default, there is a functional interface, although you can also use
an object-oriented interface. (Different objects will not share the same
data.)REVISION HISTORY
For a detailed history see the Changes file included in this
distribution.SEE ALSO
The MIME::Types module has a similar functionality, but with a more
complex interface.LWP::MediaTypes will guess the media type from a file extension,
attempting to use the ~/.media.types file.An "official" list of Media Types can be found at
http://www.iana.org/assignments/media-types.AUTHOR
Robert RothenbergContributors
Martin McGrathAcknowledgements
Some of the code comes from self module (by Kang-min Liu). The data for
the media types is based on the Debian `mime-support' package,
http://packages.debian.org/mime-support, although with *many* changes
from the original.Suggestions and Bug Reporting
Feedback is always welcome. Please use the CPAN Request Tracker at
http://rt.cpan.org to submit bug reports.The git repository for this module is at
https://github.com/robrwo/Media-Types-Simple.COPYRIGHT & LICENSE
Copyright 2009-2014 Robert Rothenberg, all rights reserved.This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.