Re: Packing file data into a variable???
| From: | Richard Lynch | Date: | Sat, 22 Sep 2001 19:59:17 +0000 |
| Subject: | Re: Packing file data into a variable??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68360@lists.php.net to get a copy of this message | ||
header("Content-type: audio/m3u"); # Or something not unlike that... Check
what you get for a static m3u file.
header("Content-length: " . strlen($buffer));
Those two should do it.
If you have problems, check the output from a static file, and add headers
until it works...
>From a Un*x command prompt, just do this:
telnet yourserver.com 80
GET /some/path/to/static.m3u HTTP/1.0
Hit return twice after that last line.
If you're on Windoze, you'll need to find a telnet client that will let you
send raw commands, which, alas, is not what ships with Windows. You end up
with some damn GUI if you try this in a default config from MS-DOS prompt
:-(
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Chris Cocuzzo <cuzo@mediaone.net>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Saturday, September 22, 2001 12:51 PM
Subject: [PHP]Packing file data into a variable???
hey-
my main goal here is to be able to stream an mp3 through any player that can
accept m3u files. My idea was to use the format of an m3u file, which looks
like this:
#EXTM3U
#EXTINF:324,cs-1.mp3
http://www.fplg.net/audio/cs-1.mp3
and pack it into a variable to be sent out using a header command...as such:
$buffer = "#EXTM3U\n";
$buffer .= "#EXTINF:-1,cs-1.mp3\n";
$buffer .= http://www.fplg.net/audio/cs-1.mp3;
I'm not sure of the exact header command I should use, or rather the format
of the command I'd send using the header function, but is this possible or
do I need to do this some other way??
chris