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.

  1. Access the OSGi Web Console at /system/console/configMgr on a development or staging instance.

  2. 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.

  3. In Apache Sling Commons MIME Type Service, add image/svg+xml svg to the mime.types property.

  4. If upload restrictions are enabled, add image/svg\+xml to the allowedAssetMimes property in Day CQ DAM Asset Upload Restriction.

  5. Save the changes and verify that SVG files can be uploaded.

  6. 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.

  7. 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
  8. Use configuration such as the following for SVG support:

    org.apache.sling.commons.mime.internal.MimeTypeServiceImpl.cfg.json

    code 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"
  ]
}
  1. If needed, use run-mode-specific folders, such as /apps/<project>/config.author/ or /apps/<project>/config.publish/.
  2. Deploy these configuration files using your standard Managed Services deployment process.
  3. After deployment, verify SVG upload functionality in the target environment.
recommendation-more-help
experience-cloud-kcs-help-kbarticles