OK, getting there: Here's what I've got that provides the proper download dialog:
$r->content_type('application/x-download');
$r->err_headers_out->add('Content-disposition' => ("attachment; filena
+me=$filename"));
my ($st,$sth) = ();
$st = "SELECT bin_data FROM forms WHERE filename = '$filename'";
$sth = $dbh->prepare($st) or die "Prepare Failed! " . $st . $dbh->errs
+tr();
$sth->execute() or die "Execute Failed! " . $st . $sth->errstr();
my $filedata = $sth->fetchrow();
$sth->finish();
$m->print($filedata);
return;
But the PDF is un-openable upon return. Is that a transmission problem, or a db problem or what? |