#!/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 ;