Download then display page

"Chris Faust" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <07ed01ce45c0$55d1e720$0175b560$@com>
Hi,

 

I'm trying to have a form submission package up the results in a xls file
and then start the download for the user as well as present a page where
they can click on the file if the download has not already automatically
started.

 

I can do each separately but not both together, I have something like this:

 

... Make up our xls file download and put it in $output

 

$r->content_type('application/xls');

$r->err_headers_out->add('Content-Disposition' => 'attachment; filename="' .
$download_name . '"');

$r->print($output);

$content->param('set some html template vars....');

$r->content_type('text/html');

print $content->output;

 

When I due the above, then I get prompted for the download but that is it, I
never get the page. Even if I reverse the order and try to do the page
first:

 

$r->content_type('text/html');

print $content->output;

$r->content_type('application/xls');

$r->err_headers_out->add('Content-Disposition' => 'attachment; filename="' .
$download_name . '"');

$r->print($output);

$content->param('set some html template vars....');

 

That still doesn't work. Probably not a mod_perl specific question but I'm
hoping someone can shed some light

 

TIA!

-Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.