print $page->p("Hello All, Downloading file");
my @contents= $ssh->file_content("$dir/$file", 1);
download(@contents, $file);
...
...
...
sub download {
use strict;
my @content = shift;
my $filename = shift;
print "Content-Type:application/x-download\n";
print "Content-Disposition: attachment;filename=$file\n\n";
print @content;
return 1;
}
但它不是下载它,而是在屏幕上打印文件的内容。请告诉我我哪里错了?