serving mp3 with httpd stack of soapdog - how to modify the server header
Andre Garzia
soapdog at mac.com
Mon Jul 17 10:50:23 EDT 2006
Franz,
Hello, err... I am the soapdog. :-)
That stack is ancient, I have better code now that will probably be
able to serve mp3 out of the box. Since I am rebuilding my page the
new code is not available yet but I can send it to your email. Do you
want me to send it to you?
it's easier in the new server to deal with all kinds of mime types.
Also remember mp3 files must be read with binfile: and not file:.
Cheers
andre
On Jul 17, 2006, at 7:21 AM, runrev at animabit.de wrote:
> Hi
> Using the http daemon of soapdog at
> http://homepage.mac.com/soapdog/rev/revhttpd.html
> I tried to modify this stack for serving mp3 and wav sounds from a
> local webserver.
>
> The modification in the stack script:
> if a file with extension mp3 has been called with an URL like
> http://127.0.0.1:8080/quotes.mp3
> then serve the content of the property mp3data of this stack.
> Before this command I have included the mp3data in the stack
> set the mp3data of this stack to URL "binfile:c:/test.mp3"
>
> case "mp3"
> put the mp3data of stack "quotes" into mp3file
> --put "Content-type: audio/x-mp3" & lf & lf & the mp3data of stack
> "quotes" into mp3file
> write mp3file to socket SocketID
> close socket socketID
> pass serverread
> break
> The browser interprets the data sent as text and shows the binary
> file in the web browser like an html page.
> I tried to put the HTML content-type before the data like in apache
> and perl - but because this is a feature of the apache server, this
> was nonsense - the line will be served to the browser of course.
> My Question: How can I change the script to serve the binary data
> of the mp3 file in a way the browser can get it as a mp3 file and
> play it as a sound? How can I implement the header like apache
> does? (The same would be interesting for serving swf).
> Regards,
> Franz Böhmisch
> boehmisch at animabit.de
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list