PHP downloads at 0 bytes
<p>I have ZIP files in a directory that is one step up from the root directory (to prevent hotlinking etc...). Here is the code: </p>

<pre><code>&lt;?php
    $filename = $_GET['id'];
    if(!$filename){
        header("Location: index.html");
    } else{
    function send_download($filename){
    $file_path = '../../../../downloads/' . $filename . '.zip';
    $file_size=@filesize($file_path);
    header("Content-Type: application/x-zip-compressed");
    header("Content-disposition: attachment; filename=$filename");
    header("Content-Length: $file_size");
    readfile($file_path);
    exit;
    } 
    send_download($filename);
    }
    ?&gt; 
</code></pre>

<p>All the ZIP files are fine but using this method on an 'a' tag causes the downloads to be 0 bytes in file size! :(</p>

<p>Any ideas as to why?</p>

<p>Many thanks!</p>
