If the program is running on Windows then make sure to binmode the file streams. This may be what is causing the file corruption.
#!/usr/bin/perl -w use strict; my $filename ="../somepath/test.xls"; print "Content-type: application/vnd.ms-excel\n"; print "Content-Disposition: attachment; filename=$filename\n"; print "\n"; open TMP, $filename or die "Error message here: $!\n"; binmode TMP; binmode STDOUT; print <TMP>;
--
John.
In reply to Re: Force Download to a .xls file
by jmcnamara
in thread Force Download to a .xls file
by Andre_br
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |