[pmwiki-users] how to upload and show SVG files

Patrick R. Michaud pmichaud at pobox.com
Mon Feb 19 16:35:48 CST 2007


On Mon, Feb 19, 2007 at 09:58:42PM +0100, info at hassanein.ch wrote:
> I need to upload svg files and therefore I added the following 2 lines  
> into my config.php:
> $UploadExtSize['svg'] = 1024000;
> $UploadExts['svg']    = 'image/svg';
> 
> Uploading works but Attach:file.svg shows the xml text in the browser.

If you're using direct downloads from the webserver (PmWiki's default), 
then you may need your webserver to be configured to recognize .svg
files as having Content-Type: image/svg .

Or, you can set $EnableDirectDownload = 0; in a local customization
so that Attach: links go through PmWiki instead of directly to the
webserver.  Then PmWiki will be able to provide the correct
Content-Type header that the webserver isn't providing.

(Disabling direct downloading does increase the load on the webserver
somewhat, since every request for an attachment requires that PmWiki
be executed instead of being fetched directly from the filesystem.)

Hope this helps,

Pm



More information about the pmwiki-users mailing list