punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:
In the past, when I downloaded, for example, a PowerPoint file, I preceeded it with
and it always opened in PowerPoint. But I was actually downloading PowerPoint files.print "Content-type: application/vnd.ms-powerpoint\n"; print "Content-Disposition: attachment; filename=$filename\n\n";
Today, I want to download what is really an HTML file but force it to open in PowerPoint, like this:
but the file is just being displayed in the browser - it's completely ignoring the dispositoin header. (MSIE)$my_html_file = "some_file.htm"; open(FILE, $my_html_file) or dienice("cannot open file $my_html_file : + $_[0] $!"); @LINES = <FILE>; close(FILE); $filename = "thetest.ppt"; print "Content-type: application/vnd ms-powerpoint\n"; print "Content-Disposition: attachment; filename=$filename\n\n"; for $i (0..$#LINES) { print $LINES[$i]; }
Am I doing something wrong, or expecting the impossible?
Thanks.
Forget that fear of gravity,
Get a little savagery in your life.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending MIME type headers not forcing desired behaviour.
by brian_d_foy (Abbot) on Apr 05, 2005 at 21:12 UTC | |
|
Re: Sending MIME type headers not forcing desired behaviour.
by Tanktalus (Canon) on Apr 05, 2005 at 21:18 UTC | |
|
Re: Sneding MIME type headers not forcing desired behaviour.
by punch_card_don (Curate) on Apr 05, 2005 at 22:22 UTC | |
by brian_d_foy (Abbot) on Apr 06, 2005 at 00:11 UTC | |
|
Re: Sneding MIME type headers not forcing desired behaviour.
by dynamo (Chaplain) on Apr 05, 2005 at 21:13 UTC | |
by jhourcle (Prior) on Apr 06, 2005 at 03:32 UTC |