AEM Managed Services: enabling SVG ingestion in DAM via OSGi Configuration
If SVG files are rejected when you upload them to DAM on AEM Managed Services, update your MIME type and asset upload restriction OSGi configurations to allow the image/svg+xml MIME type. Persist the change in your project code so it survives future deployments.
Description description
Environment
Adobe Experience Manager (AEM) (all versions, Managed Services)
Issue/Symptoms
The user is unable to upload SVG files to DAM. Attempts to upload SVG assets may result in errors or the assets being rejected, depending on current MIME type and upload restriction configurations. No specific error messages are shown, but SVG files are not accepted for ingestion.
- SVG files are not listed as allowed asset types.
- The upload interface might silently reject SVG files or display a generic unsupported file type message.
Reference documentation: Configuring SVG support in AEM
Resolution resolution
Follow these steps to resolve the issue.
-
Access the OSGi Web Console at
/system/console/configMgron a development or staging instance. -
Locate the Apache Sling Commons MIME Type Service (
org.apache.sling.commons.mime.internal.MimeTypeServiceImpl) and the Day CQ DAM Asset Upload Restriction (com.day.cq.dam.core.impl.assetupload.DamUploadAssetFilter) configurations. -
In Apache Sling Commons MIME Type Service, add
image/svg+xml svgto themime.typesproperty. -
If upload restrictions are enabled, add
image/svg\+xmlto theallowedAssetMimesproperty in Day CQ DAM Asset Upload Restriction. -
Save the changes and verify that SVG files can be uploaded.
-
Do not rely on manual Web Console changes as the long-term source of truth for production. Persist the configuration in your codebase so it remains reproducible across deployments and environments.
-
Maintain the OSGi configuration in project-controlled paths, such as:
/apps/<project>/config/org.apache.sling.commons.mime.internal.MimeTypeServiceImpl.cfg.json/apps/<project>/config/com.day.cq.dam.core.impl.assetupload.DamUploadAssetFilter.cfg.json
-
Use configuration such as the following for SVG support:
org.apache.sling.commons.mime.internal.MimeTypeServiceImpl.cfg.jsoncode language-none { "mime.types": [ "image/svg+xml svg", "image/png png", "image/jpeg jpg jpeg" ] }
com.day.cq.dam.core.impl.assetupload.DamUploadAssetFilter.cfg.json
{
"allowAllMime": false,
"allowedAssetMimes": [
"image/svg\\+xml",
"image/jpeg",
"image/png"
]
}
- If needed, use run-mode-specific folders, such as
/apps/<project>/config.author/or/apps/<project>/config.publish/. - Deploy these configuration files using your standard Managed Services deployment process.
- After deployment, verify SVG upload functionality in the target environment.