Re: file targets
Esteban Manchado Velázquez <[email protected]>
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <20040204095344.GA875@rojo> |
On Tue, Feb 03, 2004 at 08:53:06PM -0500, Daniel Bretoi wrote:
> > I suppose he means "producing" on the fly some content, and make the
> > browser download it with a controlled filename.
> >
> > If it's so, you must use the following headers:
> >
> > Content-Type: application/pdf
> > Content-Disposition: attachment; filename=myfilename.ext
>
> I've been trying to figure thi sout, but how do I actually send the
> header?
I'm not sure how to do it in mod_ruby. I suppose you have to look at the
Apache.request object. See http://rubydoc.org/books/modruby/c434.htm . In case
it does help in anything, in Perl (mod_perl) is something like:
$r->header_out("Content-Disposition", "attachment; filename=$myfilename");
$r->content_type($mime)
I suppose in mod_ruby is
Apache.request.header_out("Content-Disposition", "blah")
HTH,