Microsoft appear to have made XP less standards-compliant than earlier versions of IE.. one of the things that has tripped me up is the necessarity of making the server tell the browser that pages may be cached, otherwise IE for XP will refuse to download the file to open.
Your use of the Content-Disposition: attachment; appears to be correct so I'm puzzled as to why the IE browser isn't opening in a new window. Just as an aside I would do two new things in your script:
1. add a Content-Length: $bytes line so that your browser can estimate how long the download will take.
2. read the file in using read instead of <FILE> as it is a binary file without record separators.. e.g.
my $template = "filename.ppt"; my $fsize = ( stat( $template ) )[7]; if ( ! open( FILE, "<$template" ) ) { die( "Cannot open $template, $!" ); } print( "Content-Disposition: attachment; filename=\"$template\"\n" ); print( "content-type: application/vnd.ms-powerpoint\n" ); print( "Content-Length: $fsize\n" ); print( "\n" ); my ( $result, $data ); while ( $result = read( FILE, $data, 8192 ) ) { print( $data ); } close( FILE );
In reply to Re: Different client-side behaviours from two theoretically identical download scripts.
by monarch
in thread Different client-side behaviours from two theoretically identical download scripts.
by punch_card_don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |