sub retrieveFile { my $file = shift; if(not -e $file) { croak "Could not locate file: $file)"; } if(not open(FH, $file)) { croak "Could not open file: $file"; } my $filesize = -s $file; ## Note type will need to change based on the type of file that is ## returned. print $cgi->header(-type=>'application/vnd.ms-excel', -Content-Disposition=>"attachment; filename=$fi +le", -Content_Length=>$filesize); while(<FH>) { print; } close FH; }
In reply to Re^2: Launching Excel from a CGI
by rashley
in thread Launching Excel from a CGI
by rashley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |