Fixing stupid web server mishacks.

brian_d_foy on 2004-05-07T08:47:42

The folks at www.marketplace.org use PHP to generate a thing that is supposed to tell RealPlayer which Akamai server to talk to (isn't Akamai supposed to do that transparently?).

The PHP puts in some extra line breaks though, and my RealPlayer barfs on it. So, out comes the Perl. I write a CGI wrapper to get the PHP output, create some SMIL content, and throw that back at my browser.

#!/usr/local/bin/perl

use LWP::Simple qw(get);

my $data = get( "http://marketplace.publicradio.org/play/current_mp.php" ); $data =~ s/^\s*|\s*$//g;

print <<"HERE"; Content-type: application/smil Content-dispostion: filename=marketplace.smil X-Docs: http://service.real.com/help/library/guides/production8/htmfiles/smil.htm#33551

HERE


Now the major disappointment sets in. Firefox apparently ignore the content type and tries to save the file. I have to resort to the old Internet Explorer kludge of adding /marketplace.smil in the path info. Ugh.

Still, it works, and that's all I need.


Content-disposition

davorg on 2004-05-07T09:27:28

You problems may stem from the fact that you have mispelt "Content-disposition". You should also have a "type" on the content disposition header.

Content-disposition: attachment;filename=marketplace.smil

Re:Content-disposition

brian_d_foy on 2004-05-07T09:47:14

That might explain things. :)