Re: PHP5 - How Do I Let Users Download Music Files?

From: Date: Mon, 06 Sep 2004 09:10:13 +0000
Subject: Re: PHP5 - How Do I Let Users Download Music Files?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-195971@lists.php.net to get a copy of this message
On Sun, 2004-09-05 at 05:41, php-list@xenonsolutions.com wrote: > I want to build a music site, all copyrights intact, and I want users to be > able to download mp3 or realplayer files using a one-click link. When they > click on a link they will simply be given a typical download window to save > that music file. How do I go about doing that and how should my file > structure work? What should the link include? Is it possible to just say, > for example, http://somesite.com/music/something.mp3? Also, if > I wanted them > to listen to streamed music does PHP have any specialized functions I could > use to achieve that? I just need some direction. Any help would be > appreciated. Thank you. For the downloading part, Google "php force download". If you just give the users a link (like in your example) there is nothing that's stopping them from simply requesting the URL. I would suggest you store the files outside your webroot and then have PHP access them (this way, Apache can't see them). Listening to streaming music really doesn't have much to do with PHP. You would need a streaming server (like Windows Media Services, or the open source Darwin Streaming Server (from Apple)). Other options include shoutcast, real media, etc.

« previous php.general (#195971) next »