File MIME

Component ID

269521

Component name

File MIME

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

11594

Component created

Component changed

Component body

Drupal determines the MIME type of each uploaded file by applying a MIME type mapping to the file name. The default mapping is hard-coded in ExtensionMimeTypeGuesser (Drupal 8), file_default_mimetype_mapping() (Drupal 7) or file_get_mimetype() (Drupal 6).

The File MIME module allows site administrators to alter the built-in mapping. For example, you may wish to serve FLAC files as audio/flac rather than application/x-flac.

On the File MIME settings page, the MIME type mapping can be extracted from the server's mime.types file and/or configured via a text field, and on Drupal 7 and Drupal 8, can also be applied retroactively to all previously uploaded files.

In Drupal 7 and Drupal 8, disabling this module will restore Drupal's built-in mapping. In Drupal 6, uninstalling this module will delete the mime_extension_mapping variable, thus restoring Drupal's built-in mapping.