summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authormark <mark>2011-08-16 02:09:53 +0000
committermark <mark>2011-08-16 02:09:53 +0000
commit35540b0694faa387546391a3e5f8d67b17244188 (patch)
treef03a44d623894bed0231e72dc02394dfa68cf64f /httemplate/misc
parent4fc92f4d9988015ca6c19bd84912350725043a1b (diff)
reliably start batch download, #947
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/download-bill_batch.html13
1 files changed, 9 insertions, 4 deletions
diff --git a/httemplate/misc/download-bill_batch.html b/httemplate/misc/download-bill_batch.html
index 70e3003ce..9b5f1efa8 100644
--- a/httemplate/misc/download-bill_batch.html
+++ b/httemplate/misc/download-bill_batch.html
@@ -12,10 +12,15 @@ $m->clear_buffer;
$r->content_type('application/pdf');
$r->headers_out->add( 'Content-Disposition' =>
'attachment;filename="invoice_batch_'.$batchnum.'.pdf"');
+my $cookie = CGI::Cookie->new(
+ -name => "bill_batch_download",
+ -value => $batchnum,
+ -expires => '+1d',
+);
+$r->headers_out->add( 'Set-Cookie' => $cookie->as_string );
$m->print($content);
-#$batch->pdf('');
-#my $error = $batch->replace;
-# warn "error deleting cached PDF: '$error'\n" if $error;
-#}
+$batch->pdf('');
+my $error = $batch->replace;
+warn "error deleting cached PDF: '$error'\n" if $error;
</%init>