Thanks! I knew it had to be something simple, but none of my O'Reilly books mention this one, and none of my online searches popped it up, either. 'Needed a better-formed query, I guess...
| [reply] |
Have a look at the section on tying file-handles in the perltie man page.
I did something similar with XML::Writer a while back,
which also expect a file-handle for output.
Odds are good, given the simple nature of the problem
at hand, you can get away with writing only the TIEHANDLE,
PRINT, CLOSE and DESTROY methods.
You may not even need the DESTROY. But not knowing what the
PDF libs are doing, you may have to provide PRINTF
and WRITE (the method called when syswrite()
gets called). Point is, you shouldn't need to bother with
the read-oriented methods, at least.
--rjray
| [reply] |
You can get around the IE stupidiy in a file download by explicitly setting the content-type to "application/download". Here is the code I use (using Mason, but I'm sure you can extrapolate):
my $subr = $r->lookup_file($file);
return 404 unless -f $file and $subr->status == 200;
$r->content_type("application/download");
$r->header_out('Content-disposition' => "attachment; filename=\"$fil
+e\"");
$r->send_http_header;
return 200 if $r->header_only;
$subr->run;
$m->abort;
Hope that helps
-pete
"I am Jack's utter lack of disbelief" | [reply] [d/l] |
| [reply] |
No problem, I'm glad my wrestling match with it is saving others from having to wrestle it.
-pete
"I am Jack's utter lack of disbelief"
| [reply] |