punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:
I must first admit that this is a Perl question only insofar as it is a Perl scriupt producing the output that is causing problems. The problem MAY have nothing to do with the Perl script producing the output.
I have two Perl download scripts that get a Powerpoint file from the server, preceed it by a header, then write out the file line by line. The file headers tell the browser what kind of file it is and what its disposition is. The scripts run on different servers, both UNIX boxes. The important part of the scripts - the file getting, header attaching and file downloading parts - are identical. One script is in fact a copy of the first with the only difference being how the script assembles the output file name.
The headers are intended to, and for some time have successfully, cause MSIE to open the PPT in a new, separate instance of PowerPoint on the user's machine. That is, NOT in the browser. As I said, this has worked perfectly for both scripts for months for dozens of users with various configurations.
The Problem - a user who is running Windows XP, the first I know of, reports that files downloaded from script 1 open as intended, but files downloaded via script 2 on the other server open in the browser. With identical file headers, this is a great mystery, and causes all sorts of functionality problems.
Here are the salient partrs of the script:
$download_filetype = '.ppt'; open(FILE, $template) or dienice("cannot open file $template : $_[0] $ +!"); @LINES = <FILE>; close(FILE); $filename = join('_', $session_id, $download_filetype); print "Content-type: application/vnd.ms-powerpoint\n"; print "Content-Disposition: attachment; filename=$filename\n\n"; for $i (0..$#LINES) { print $LINES[$i]; }
Any ideas will be most welcome.
Forget that fear of gravity,
Get a little savagery in your life.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Different client-side behaviours from two theoretically identical download scripts.
by Errto (Vicar) on Nov 30, 2005 at 04:11 UTC | |
|
Re: Different client-side behaviours from two theoretically identical download scripts.
by monarch (Priest) on Nov 30, 2005 at 03:40 UTC | |
|
Re: Different client-side behaviours from two theoretically identical download scripts.
by xdg (Monsignor) on Nov 30, 2005 at 02:37 UTC | |
|
Re: Different client-side behaviours from two theoretically identical download scripts.
by punch_card_don (Curate) on Dec 01, 2005 at 00:38 UTC |