Forum Moderators: coopster
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
width="400" height="168" >
<param name="allowScriptAccess" value="sameDomain"/>
<param name="movie" value="http://www.mysite.com/xspf/xspf_player.swf?song_url=<?php echo $link; ?>&song_title=<?php echo $extitle; ?>"/>
<param name="quality" value="high"/>
<param name="bgcolor" value="#E6E6E6"/>
<embed src="http://www.mysite.com/xspf/xspf_player.swf?song_url=<?php echo $link; ?>&song_title=<?php echo $extitle; ?>"
quality="high" bgcolor="#E6E6E6" name="xspf_player" allowscriptaccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
align="center" height="168" width="400"> </embed>
</object>
If I place the audio in folder outside the webroot, what should I specify for the url? Would I use file://user/home/audio/audio.mp3? How exactly would I specify url if there really isn't url to the file?
thanks,
brian
Ex: example.com/mp3loader.php?id=satriani_rocks_2006
I don't know the specifics for PHP (Perl, CF, and JSP guy) but you should be able to lookup what code is needed to fetch the file via the file system and return it with the proper headers. Sorry I can't give you the exact code.
<?php
//do membership check here (e.g. check cookie or session)
$filename="path_to_file/".intval($_GET[fileid]).".mp3";
header("Content-type: application/audio-mp3");
header("Content-length: ".filesize($filename));
$fh=fopen("w",$filename);
while ($data=fread($fh,1024)) { print $data; flush(); }
?>