Force 'save as' svg files
<p>I've got the following file:</p>

<p>download.php</p>

<pre><code>&lt;?php 

$filename = $_GET["filename"];

if ($filename) {
$path = "/svg_files/".$filnavn."";
header('Content-Transfer-Encoding: binary');  // For Gecko browsers mainly
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($path)) . ' GMT');
header('Accept-Ranges: bytes');  // For download resume
header('Content-Length: ' . filesize($path));  // File size
header('Content-Encoding: none');
header('Content-Type: application/svg');  // Change this mime type if the file is not PDF
header('Content-Disposition: attachment; filename=' . $filename);  // Make the browser display the Save As dialog
}
?&gt;
</code></pre>

<p>It's located in the svg_files folder. But when I run:</p>

<p>myweb.com/svg_files/download.php?filename=file.svg</p>

<p>I just get an empty file.</p>
