470,849 Members | 1,129 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Save As box question

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
2 3270
"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
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.

Similar topics

4 posts views Thread by Andras Gilicz | last post: by
9 posts views Thread by Ivan Demkovitch | last post: by
3 posts views Thread by B-Dog | last post: by
2 posts views Thread by Peter Proost | last post: by
5 posts views Thread by C Watson | last post: by
12 posts views Thread by =?Utf-8?B?RnJlZU5FYXN5?= | last post: by
3 posts views Thread by Koliber (js) | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.