bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monasterians,
I'm in GGI::Application and using the octet-stream parameter of the header_add method to stream a file download.
This works fine, but after streaming the file, I would like to output another screen dealing with what was just downloaded. Is there a way to return 2 different outputs? Below is a stripped down version of what I have.
package FooBar; use base 'CGI::Application'; use HTML::Template; sub setup { my $self = shift; $self->start_mode('sh'); $self->mode_param('rm'); $self->run_modes('sf' => 'save_file'); } sub save_file { my $self = shift; my $some_file = "This,is,a,test"; $self->header_add( -type =>'application/octet-stream', -attachment => "somefile.csv', -expires =>'0', ); return $some_file; }
Tried this, but all it did was stream the file:
$template = $self->load_tmpl( "foobar.tmpl"); return ($template->output, $some_file);
Ideas? TIA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: After sending file by octet/stream, open new template page
by Fletch (Bishop) on May 16, 2006 at 00:01 UTC | |
by bradcathey (Prior) on May 17, 2006 at 00:45 UTC |