Created
January 7, 2014 14:24
-
-
Save septor/8300031 to your computer and use it in GitHub Desktop.
Force download MP3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = ""; // file to download, you could use $_GET['file'] and include it in the URL somehow | |
header ("Content-type: octet/stream"); | |
header ("Content-disposition: attachment; filename=".$file.";"); | |
header ("Content-Length: ".filesize($file)); | |
readfile($file); | |
exit; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment