# code ripped from perlmonks.org/index.pl?node_id=9277 chdir($filepath) || die "Unable to chdir to filepath"; my $filesize = -s $filename; # print full header print "Content-disposition: attatchment; filename=$filename\n"; print "Content-Length: $filesize\n"; print "Content-Type: application/x-tar\n\n"; # open in binmode open(READ,$filename) || die; binmode READ; # stream it out binmode STDOUT; while () { print; } close(READ); #### my $q = CGI -> new(); print $q -> header( "text/html" ), $q -> start_html (-title => "File Download", -bgcolor => "#ffffcc" ), $q -> p ( "If the file does not begin to dowload automatically it can be downloaded here." ), $q -> p ( "Back to foo"), $q -> p ( "Bar Home"), $q -> end_html;