Re: file targets

Kirk Haines <[email protected]>
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
On Tue, 3 Feb 2004, Daniel Bretoi wrote:

> > Content-Type: application/pdf
> > Content-Disposition: attachment; filename=myfilename.ext
> > 
> 
> I'd been reading the RFC for this, and for some reason the filename
> parameter didn't make sense until I read this. BUt let me just see if I
> got it right.
> 
> The headers are the Content-
> the filename param is the name of the filename which will show up as the
> default "save as". 
> 
> The actual data will be the file.

Yes, that's exactly right.

For example, if you wanted to return data from a database query as a 
downloadable comma seperated value file, you'dset content-type to text/csv 
and you'd set content-disposition, as above, with your filename.

Then the data portion of what you are sending would be the CSV content 
that is to make up the downloaded file.


Kirk Haines
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.