If somebody clicks a link, how can you write PHP code to take a file from the websites directory(in this case a .mp3 file) and then save it, causing a prompt box to pop up asking where the user wants to save the file?
[code=php] $filedata = file_get_contents($filename); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header('Content-Type: application/force-download'); header('Content-Disposition: attachment; filename="'.$filename.'"'); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".strlen($filedata)); echo $filedata; exit(); [/code]
Help @Ascendancy spread the word by sharing this article on Twitter...