开发者

playing mp3 files located outside of public_html with soundmanager 2

I have to stream some mp3 files located outside of public_html with soundmanager2 or any other flash-based mp3 player but i can't make it 开发者_StackOverflowwork.

Do you know any workaround on this subject ?

Thanks


You could write a little php script which loads the content from the file and sends it. If your intention is to prevent the user from copying the sound this is probably not possible this way. If you just can't move the files to public_html you could create a symbolic link or just the php script.

You could use readfile like here:

header('Content-Type: audio/mpeg');
header('Content-Disposition: attachment; filename="audio.mp3"');
readfile('../files/audio.mp3');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜