php force download extension
<p>I'm trying to force a download so this is my code:</p>

<pre><code>$file = 'test.m4r';
$mime = 'audio/aac';
header("Pragma: public"); // required
header("Expires: 0"); 
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header('Content-Description: File Transfer');
header("Content-Type: $mime");
header('Content-Length: ' . filesize($file));          
header('Content-Disposition: attachment; filename=' . basename($file));
readfile($file);
</code></pre>

<p>The file extension should be .m4r, even though the mime is aac. On some computers it's downloaded as test.m4r, while on other computers, the file has extension of <strong>test.m4r.acc</strong>. How do I fix this problem?</p>

<p>Thank you!</p>
