Module ringo/mime

This module provides functionality for determining the MIME type for a given file extension.

Functions

Properties


MIME_TYPES

A list of common MIME types, keyed by file extension.


mimeType (fileName, fallback)

Determines the MIME type for the given file extension. If the file extension is unknown, the fallback argument is returned. If that is undefined, the function returns "application/octet-stream".

Parameters

string fileName a file name
string fallback MIME type to return if file extension is unknown

Returns

string the MIME type for the file name