Save As box question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • OneSolution

    #1

    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


  • Michael Fuhr

    #2
    Re: Save As box question

    "OneSolutio n" <onesolution@ja takainc.com> writes:
    [color=blue]
    > 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.[/color]

    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.cs v");

    --
    Michael Fuhr

    Comment

    • OneSolution

      #3
      Re: Save As box question

      Thanks.

      "Michael Fuhr" <mfuhr@fuhr.org > wrote in message
      news:3fc44fd4_1 @omega.dimensio nal.com...[color=blue]
      > "OneSolutio n" <onesolution@ja takainc.com> writes:
      >[color=green]
      > > 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[/color][/color]
      format[color=blue][color=green]
      > > and then pop up a box asking them to save it.[/color]
      >
      > 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.cs v");
      >
      > --
      > Michael Fuhr
      > http://www.fuhr.org/~mfuhr/[/color]


      Comment

      Working...