cancel
Showing results for 
Search instead for 
Did you mean: 

Loading SVG from Portal Application EAR?

Former Member
0 Kudos

Hello there,

we are trying to use SVG images in a portal application.

Unfortunately, I can't get any browser to render them.

I've build a small HTML file, which includes an SVG and a PNG images as well, for comparison.

If I upload these files to a normal web server, like apache, the SVG image gets properly rendered, whereas if loaded from Enterprise Portal, the SVG image is not rendered.

If I compare the requests to the SVG image, the main difference I notice, is the missing response header

Enterprise Portal:


Content-Type: content/unknown

Apache:


Content-Type: image/svg+xml

Can someone help me to get SVG images properly loaded by the browser?

(I am using Enterprise Portal 7.31)

UPDATE:

I was able to get the issue more precise:

If retrieved from KM, the SVG image loads correctly, since I added the mime type in Portal's System Administration -> Knowledge Management -> Utilities -> Mime Types.

But if loaded directly from my Portal Application, mime type is not set and rendering fails.

Is there a way to specify mime types for resources contained in an EAR?

Thanks in advance,

Sascha.

Accepted Solutions (1)

Accepted Solutions (1)

christian_santej
Active Participant
0 Kudos

hi sascha,

check out this link Managing MIME Types - Administration - SAP Library ; i think you have to add you're MIME type there. give it a try and let me know.

regards,

christian

Former Member
0 Kudos

Absolutely correct, Christian!

You've to configure MIME property of HTTP Provider Service, adding configuration for mime type SVG, adding:


{

    .svg,

    image/svg+xml

}

Kind regards and many thanks,

Sascha.

christian_santej
Active Participant
0 Kudos

excellent!

you're welcome and thanks for your feedback.

regards,

christian

Answers (1)

Answers (1)

SandipAgarwalla
Active Contributor
0 Kudos

Sascha

Did you ever find a solution for this?

I currently have the same issue. I am building a custom masthead, and cant seem to load the svgs.

Thanks

Sandip