note 108102 deleted from features.commandline.webserver by sixd
| From: | sixd@php.net | Date: | Tue, 15 May 2012 00:53:36 +0000 |
| Subject: | note 108102 deleted from features.commandline.webserver by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187980@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
I tried to access SVG files via the built-in webserver,
but only a download dialog was shown.
So I use this router script to accomplish my needs.
Maybe it is useful to someone. Bye
<?php
$path = pathinfo($_SERVER["SCRIPT_FILENAME"]);
if($path["extension"] == "svg")
{
header("Content-Type: image/svg+xml");
readfile($_SERVER["SCRIPT_FILENAME"]);
}
else return FALSE;
?>