"OneSolution" <on*********@jatakainc.com> writes:
My users can pull up some information from the database and view it.
However, I want to give them the option to say "save" and so instead of
displaying it on screen, the script should format the data into a CSV format
and then pop up a box asking them to save it.
Browsers typically pop up a "save" window when they don't know how
to handle a particular MIME type; in many browsers, setting the
document's Content-Type to application/octet-stream will make this
happen. You can use the Content-Disposition header to suggest a
filename. Here's an example:
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=foo.csv");
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/