SVG is not showing on Google Chrome

Avatar

Avatar

otavios60241350

Avatar

otavios60241350

otavios60241350

05-04-2018

[Thread Edited By Adobe]

/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here

Go ahead and to it now: https://adobe.ly/3eDnB4v */

 

Actual Question:

Hi, I have some SVG files on my assets and I want use it on my component so a create a cq:dialog with a file field and on htl I am using properties global object, but the svg image are not working on chrome.

 

CODE:

file field:

 

<file

jcr:primaryType="nt:unstructured"

sling:resourceType="cq/gui/components/authoring/dialog/fileupload"

autoStart="{Boolean}false"

class="cq-droptarget"

fileNameParameter="./fileName"

fileReferenceParameter="./fileReference"

mimeTypes="[image/gif,image/jpeg,image/png,image/webp,image/tiff,image/svg]"

multiple="{Boolean}false"

name="./file"

title="Upload Image Asset"

uploadUrl="${suffix.path}"

useHTML5="{Boolean}true" />

 

HTL:

<img class="lines-about" src="${properties.fileReference}" alt="">

 

Result: Image not show if the image I select a SVG but if I select another type Image showing correctly.

desktop_exl_promo_600x100_weempoweryou.png

View Entire Topic

Avatar

Avatar

fernandou237618

Avatar

fernandou237618

fernandou237618

20-06-2018

Hi there.

I have the same problem.

We’ve created a page in Adobe AEM using DAM to serve image files. PNG image files are being served OK, but SVG image files are not being displayed correctly in Chrome (Firefox actually displays it).

The problem is: AEM http response should be returning “Content-Type:image/svg+xml” but it is actually returning “Content-Disposition: attachment; filename="yt.svg"”.

If I try to open the URL directly, Chrome doesn’t display the image (instead, it tries to download it), while Firefox displays it.

If I access other websites that uses SVG, it works OK, because their server is returning the correct HTTP response. Only content served by DAM is not OK.

Is there any solution to this annoying problem?