[PHP] How to output an MP3 file?

2006-11-15 Thread Brian Dunning
I'm trying to route all my MP3 requests through a brief PHP script to log the downloads to a database, and then I want to output the MP3 exactly as if the browser had requested it normally. So far I haven't found headers that will serve it normally; it either wants to download it as an

Re: [PHP] How to output an MP3 file?

2006-11-15 Thread Jon Anderson
Brian Dunning wrote: header('Content-Type: application/octet-stream'); snip What should I change? I think you should use a content type more specific to MP3s. My install of firefox seems to think the appropriate content type for those is audio/mpeg - try that, and see what happens.

Re: [PHP] How to output an MP3 file?

2006-11-15 Thread Brian Dunning
Thanks Jon - You put me on the right track. Apparently audio/x-mp3 is what iTunes wants to see, and it seems to work with browsers. :) On Nov 15, 2006, at 10:06 AM, Jon Anderson wrote: Brian Dunning wrote: header('Content-Type: application/octet-stream'); snip What should I change?