Re: file targets
Esteban Manchado Velázquez <[email protected]>
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <20040203200800.GA1008@velutha> |
On Tue, Feb 03, 2004 at 02:37:44PM -0500, Kirk Haines wrote: > On Tue, 3 Feb 2004, Daniel Bretoi wrote: > > > On several forums, I have seen links of the form > > > > http://site/download.php?id=230923 > > > > and when the link is followed, a file download follows, and the filename > > will be something like reasonable-name.tar.gz or something. > > > > Does anyone know how this is done? or if it can be done with ruby? > > Issue a browser redirect to the desired filename. And can't just about > everything be done with Ruby? ;) 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 HTH, -- Esteban Manchado Velázquez <zoso*demiurgo*org> - http://www.demiurgo.org No software patents in Europe! - eurolinux.org - proinnova.hispalinux.es Join Amnesty International - http://www.amnesty.org/actnow