albert has asked for the wisdom of the Perl Monks concerning the following question:
This is working fine, but I'd like to alter the name of the output. Right now the output is saved as "name_of_CGI_script.gz" (only tested with Safari so far, other browsers/OS may behave differently.). How can I change to a default file name related to other options the user has selected? Also, how could I make that be a suggested file name, which causes a local "Save As..." dialog to appear (again, I realize there might not be a 100% universal answer for all Browser/OS combos.)use Compress::Zlib; if($out eq 'gz'){ binmode STDOUT; print("Content-type: application/x-gzip\n\n"); my $gz = gzopen(\*STDOUT, "wb") or die "Cannot open stdout: $gzerrno\n" ; foreach my $line (@lines){ $gz->gzwrite($line) or die "error writing: $gzerrno\n" ; } $gz->gzclose; }
-albert
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Suggested file name for CGI output
by holli (Abbot) on Aug 29, 2006 at 11:02 UTC | |
by albert (Monk) on Aug 29, 2006 at 12:59 UTC |