By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,384 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,384 IT Pros & Developers. It's quick & easy.

Save As box question

P: n/a
Hi All,

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.

Is this something hard to do?

Thanks,
Santosh
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"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/
Jul 17 '05 #2

P: n/a
Thanks.

"Michael Fuhr" <mf***@fuhr.org> wrote in message
news:3f********@omega.dimensional.com...
"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/

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.