如何配置Worklight以使用contentType = image / xml + svg提供* .svg文件? [英] How can I configure Worklight to serve *.svg files with contentType=image/xml+svg?
问题描述
当我尝试使用svg文件作为图像标记的源或作为背景图像网址时,我看不到任何内容(并且firebug告诉我无法加载给定的网址
When I try to use an svg file as the source for an image tag, or as a background image url, I don't see anything (and firebug tells me Failed to load the given url
看起来好像是因为Worklight使用 Content-Type
响应来提供它 application / octet-stream
的标题。如何让Worklight使用 image / svg + xml
发送它,以便它会正确显示吗?
It looks like it is because Worklight is serving it with a Content-Type
response header of application/octet-stream
. How can I get Worklight to send it with image/svg+xml
so that it will display properly?
推荐答案
终于找到了。将以下内容添加到server.xml:
Finally found it. Add the following to the server.xml:
<mimeTypes>
<type>svg=image/svg+xml</type>
</mimeTypes>
[您可以通过转到服务器视图打开server.xml。双击您的服务器以打开服务器概述,然后在 Liberty配置文件设置下,单击打开服务器配置]
[ You can open server.xml by going to the server view. Double click on your server to open the server overview, then under Liberty Profile Settings, click Open server configuration ]
这篇关于如何配置Worklight以使用contentType = image / xml + svg提供* .svg文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!