The key to the browser's heart, so to speak, is the Content-type header returned with the image file's content. It will be different for XWiki than for servers that the browser deals with successfully.
 
You must change your browser's mapping of the Content-type header returned from XWiki so that it handles these files the same way it handles others of the same type but a different Content-type header.  If, as is often the case, this is a ridiculous thing to have to do because it would have to be done on tens of thousands of individual machines, then you must change something in XWiki to mark it with the same type header as the ones it does understand.
 
The "something" you must change is the <mime-mapping> element of the deployment descriptor.  See the Java Servlet API document for details; my copy of XWiki doesn't contain any, but if you use Eclipse, its XML editor offers you help in constructing them.  It shows me, for example, that they must appear after the <servlet-mapping> entries and before the <welcome-file-list> element, and comprise one <extension> and one <mime-type> child element each. 
 
So, if the Content-type: header returned with the images your browser does understand were "image/svg", you would create an entry, after the <servlet-mapping> entries and before the <welcome-file-list> entry, like this one:
 
    <mime-mapping>
        <extension>.svg</extension>
        <mime-type>image/svg
 
Of course, I could be all wrong, but I love to share knowledge...

brain[sic]

 


From: playit again [mailto:ithoughtitoldyou@gmail.com]
Sent: Saturday, April 28, 2007 3:19 PM
To: xwiki-users@objectweb.org
Subject: [xwiki-users] uploading an svg file

Hi,
I am using an xwiki (version 0.9.840). My database is mysql running on Linux. I have a strange problem where when I upload an svg file and then reference the .svg file in an <object/> tag, the browser Firefox 2.0+, isn't able to display the image. Rather it asks for an external application to deal with the file. This is not a problem with the browser since I can view other .svg files. Interestingly, if I save the .svg file by right-clicking and saving to my local disk and then point my browser at my local disk it can view the .svg file no problem. So I am guessing that their is something strange about the way the xwiki returns the bytes to the browser....anyone experienced this? Any ideas?

Thanks.