hi i'm recently doing this module where the user can download audio files specifically .wma files, the only problem is i can't get them to work, what's weird though is that if i change the file to be downloaded to mp3 it can be successfully be downloaded but if i change back to .wma the file seems to be corrupted.I hope someone can shed the light here cause i'm really confuse on where i'm going wrong.
<?phpif (isset($_GET["download"])) {
$file = "music.wma"; //NOTE : IF I CHANGE THE FILE TO BE DOWNLOADED TO AN MP3 FILE THEN EVERYTHING GOES OK BUT AS FOR .wma IT'S NOT
header("Content-Type: application/octet-stream");
header("Content-Type: audio/x-wma");
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename=\"".basename($file)."\"");
readfile("$file");
} else {
echo "No file selected";
}
?>
<a href="listen_test.php?download=1">Download</a>