in reply to Launching Excel from a CGI

Set the Cotent-Type Content-Type appropriately (application/vnd.ms-excel) and then just output CSV - that would be my starting point.

-derby

Update: err ... Content-Type not Cotent-Type. Thks cog.

Replies are listed 'Best First'.
Re^2: Launching Excel from a CGI
by cog (Parson) on Oct 30, 2006 at 17:53 UTC
    I was going to say "Hey, it's not 'Cotent-Type'", but then I noticed he asked for 'exaples', so I guess you're talking the same language O:-)
Re^2: Launching Excel from a CGI
by rashley (Scribe) on Oct 30, 2006 at 18:31 UTC
    Think I got it:
    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; }