force download a MP3 file
I've seen a few posts that relate to this, but I'm still stumped.
I've set up a php file to force download a mp3 file
my query script:
<a href="music/direct_download.php?file=Go Slow - featuring Eric Siblin.mp3"></a>
and in the 'music' folder a php file called 'direct_download.php' - which has this code in it:
<?php
$file = $_GET['file'];
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>
Everything works perfectly on one server account ( my own account with a different provider). This work pretty well in all browsers I tested.
But on my client's server account ( a completely different server with the same stuff posted there) it doesn't work. The function either spins with no result or opens a new page actually showing the code that represents the mp3 file I'm assuming.
What do I need to do to get the client's server working or is there a better way to do this.