Trium918 Posted August 2, 2010 Share Posted August 2, 2010 I've search google and found bit and pieces of code, but unfortunately my head is still cloudy. I am looking for someone to point me in the right direction. I am going to attempt to write a php script that will allow the user to download free music such http://www.livemixtapes.com which is using php as well. I am looking for functions, headers, and whatever else I would need to complete this task of mines. How to step up structure of the <dir> etc... Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/209541-downloading-music-files-where-do-i-start/ Share on other sites More sharing options...
dreamwest Posted August 2, 2010 Share Posted August 2, 2010 Dont store any files on your server or youll get nicked, just index them and point your mp3 player to the file. Findtail has the same structure http://www.findtail.com/type=MP3 Quote Link to comment https://forums.phpfreaks.com/topic/209541-downloading-music-files-where-do-i-start/#findComment-1094054 Share on other sites More sharing options...
Trium918 Posted August 2, 2010 Author Share Posted August 2, 2010 Dont store any files on your server or youll get nicked, just index them and point your mp3 player to the file. Findtail has the same structure http://www.findtail.com/type=MP3 The site that I am building is equivalent to http://livemixtapes.com. To my understanding, the music files or store on their server. Quote Link to comment https://forums.phpfreaks.com/topic/209541-downloading-music-files-where-do-i-start/#findComment-1094063 Share on other sites More sharing options...
JonnoTheDev Posted August 2, 2010 Share Posted August 2, 2010 So you are basically creating an e-commerce site where users add music files to their cart and can download them once they have paid for them. Am I correct? If so, have a look at osCommerce. This is an e-commerce script that has file download functionality. http://www.oscommerce.com/ You can study and re-create the parts you need for your own site. This is too big a project to give a simple answer to. You need to break the project into smaller parts before asking for help. Quote Link to comment https://forums.phpfreaks.com/topic/209541-downloading-music-files-where-do-i-start/#findComment-1094080 Share on other sites More sharing options...
Trium918 Posted August 2, 2010 Author Share Posted August 2, 2010 So you are basically creating an e-commerce site where users add music files to their cart and can download them once they have paid for them. Am I correct? If so, have a look at osCommerce. This is an e-commerce script that has file download functionality. http://www.oscommerce.com/ You can study and re-create the parts you need for your own site. This is too big a project to give a simple answer to. You need to break the project into smaller parts before asking for help. So you are basically creating an e-commerce site where users add music files to their cart and can download them once they have paid for them. Am I correct? If so, have a look at osCommerce. This is an e-commerce script that has file download functionality. http://www.oscommerce.com/ You can study and re-create the parts you need for your own site. This is too big a project to give a simple answer to. You need to break the project into smaller parts before asking for help. No mixtapes are free. http://livemixtapes.com Quote Link to comment https://forums.phpfreaks.com/topic/209541-downloading-music-files-where-do-i-start/#findComment-1094084 Share on other sites More sharing options...
JonnoTheDev Posted August 2, 2010 Share Posted August 2, 2010 Ok, just store the music files in a directory that is outside of your document root i.e /music/ /public_html/ When a member clicks on the file that they want to download use a header to prompt a download i.e $filename = "/music/file.mp3"; header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Content-Length: ".filesize($filename)); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$filename); readfile($filename) Have a look at the php manual http://php.net/manual/en/function.header.php Quote Link to comment https://forums.phpfreaks.com/topic/209541-downloading-music-files-where-do-i-start/#findComment-1094092 Share on other sites More sharing options...
xcoderx Posted August 2, 2010 Share Posted August 2, 2010 google for tankamusic script could be of ur need. Quote Link to comment https://forums.phpfreaks.com/topic/209541-downloading-music-files-where-do-i-start/#findComment-1094111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.