MIME Type Resolution Configuration
Info: Available in brXM 16.9.0 and later.
Overview
Bloomreach Content uses a configurable MIME type resolution service to map file extensions to their associated MIME type variants. File upload components rely on this service to determine which files to accept.
Browsers and operating systems may report different MIME types for the same file extension. For example, a .csv file can be identified as text/csv, application/csv, or text/x-csv depending on the environment. The MIME type resolution service returns all recognized MIME type variants for a given extension, ensuring consistent file upload behavior across browsers.
Configuration
The extension-to-MIME-type mappings are stored in the repository at:
/hippo:configuration/hippo:modules/mimetype-resolution/hippo:moduleconfig
Each child node represents a file extension and includes a multi-valued mimeTypes property that lists all known MIME types for that extension.
Default Mappings
The service provides default mappings for common file types:
| Category | Extensions |
|---|---|
| Images | jpg, jpeg, png, gif, webp, svg, bmp, ico, tiff, tif, avif |
| Documents | pdf, doc, docx, xls, xlsx, ppt, pptx, odt, ods, odp |
| Text | txt, csv, xml, html, htm, css, js, json |
| Archives | zip, rar, 7z, tar, gz |
| Audio | mp3, wav, ogg, m4a |
| Video | mp4, avi, mov, wmv, flv, webm |
Adding a Custom Mapping
To add a MIME type mapping for a new file extension:
- Go to
/hippo:configuration/hippo:modules/mimetype-resolution/hippo:moduleconfigin the Console. - Create a child node with the extension name (without the dot) and set its primary type to
hipposys:moduleconfig. - Add a multi-valued String property named
mimeTypesthat lists all known MIME types for the extension.
Example: To add support for .heic files, configure the node as follows:
/hippo:moduleconfig/heic: jcr:primaryType: hipposys:moduleconfig mimeTypes: - image/heic - image/heif
Modifying an Existing Mapping
To add additional MIME type variants to an existing extension, locate the corresponding extension node under the module configuration and update its mimeTypes property with the new MIME type.
Runtime Reconfiguration
The system detects configuration changes automatically. You do not need to restart the application after modifying the mappings.
How the Service Resolves MIME Types
When you configure a file upload component with a list of allowed file extensions, the MIME type resolution service translates those extensions into the complete set of MIME types that browsers may report. The service uses this set to configure the client-side upload widget's accept filter.
For example, if you allow the extensions jpg and png, the service resolves them to:
image/jpeg,image/pjpeg(forjpg)image/png(forpng)
The upload widget then accepts files with any of these MIME types.