File upload or extraction fails due to unsupported or misidentified MIME types
File uploads, archive extraction, and attachment handling can fail when MIME types are not recognized or incorrectly identified. It happens due to missing MIME type mappings, restrictive upload configurations, or disabled content-based detection. As a result, files get rejected, skipped during extraction, or assigned undefined MIME types. To resolve the issue, update MIME mappings, adjust upload restrictions, and ensure proper detection settings.
Description description
Environment
- Adobe Experience Manager as a Cloud Service (AEMaaCS)
- AEM Managed Services
- AEM Forms
Issue/Symptoms
- Upload fails with Unsupported Media Type -
<filename>: undefined - ZIP extraction logs indicate files created with
mimeType null - Assets are missing after extract-archive operations
- Attachment components reject valid file types
- MIME type appears as undefined or null in processing logs
Root cause
The system determines MIME types using request headers and internal mappings. When mappings are missing or misconfigured, MIME types are assigned as null or undefined. Upload restrictions may block such files, and disabled content-based detection can cause incorrect classification of file types.
How to confirm
- Check logs for errors indicating unsupported, null, or undefined MIME types
- Verify the MIME type assigned to uploaded files in metadata properties
- Inspect extraction logs for skipped files or missing entries
- Review MIME type mappings for the affected file extensions
- Check whether upload restriction configuration blocks the identified MIME type
Resolution resolution
- Identify the MIME type assigned to the failing file using logs or metadata properties.
- Add the required MIME type mapping in the MIME type service configuration.
- Update asset upload restriction configuration to allow the identified MIME type.
- Enable content-based MIME detection if MIME types are misidentified by extension.
- Ensure MIME type mappings exist for all file extensions included in archive files.
- Update component configuration to allow required MIME types for attachment handling.
- Redeploy or restart the configuration to apply changes.
- Validate by reuploading or reprocessing the file and confirming proper MIME type assignment.