Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

SVG file not getting imported in AEM DAM

Avatar

Level 3

We have DAM Asset upload restriction configuration turned on in OSGI to allow specfic file types to DAM.

We have added "image/svg+xml " in the list to allow SVG

however still ASSET upload fails with the below log,

  1. com.day.cq.dam.core.impl.servlet.CreateAssetServlet Unsupported Media Type - RIC-model-16x9.svg:image/svg+xml

when the restriction is removed and all filetypes are allowed, this gets added in the DAM.

7 Replies

Avatar

Employee

Check the XML, and look for <dc:format>  is it image/svg+xml ? or a different format?

You can also add a rule using wildcards to cover if the mime type has a prefix to it, like:   .*image/svg+xml

Avatar

Level 3

unfortunately even after using wildcards like image/* it doesnt seem to work.

Avatar

Level 3

I tried debugging the uploaded asset with DAM Mime type service and it is getting detected as "image/svg+xml"

com.day.cq.dam.core.impl.mimeType.DamMimeTypeServiceImpl DAM Mime Type Service detected mimeType for test3.svg as: image/svg+xml

however when I allow the config in DAM asset restriction configuration it doesn't upload and gives error message, it uploads only when all MIME type is selected.

Avatar

Employee

Try to enter it exactly like this (including the dot at the beginning):

.*image/svg+xml

Avatar

Level 3

it doesnt work.

looks like a Bug raised with Adobe.

Avatar

Level 3

Hay @rajeshs28932860,

The issue is with your regEx in the OSGI Configuration it doesn't matches with the mime type. Change your regEx to image/svg\+xml it should work, Let me know if you are facing any issue.

Thanks,

Koti Syamala