Download an XML file from the server

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

    Download an XML file from the server

    I need to allow users to download and save XML files from the server to
    their local client drive. [This is so users can export data from the
    server, to be imported into other programs for analysis.]

    How can this be accomplished? I either want the link to basically
    present the user with a "save" option, or figure out some way to do it
    in javascript.

    Thanks.
  • Conrad Lender

    #2
    Re: Download an XML file from the server

    On 2008-10-20 09:21, Jon Mcleod wrote:
    I need to allow users to download and save XML files from the server to
    their local client drive. [...] I either want the link to basically
    present the user with a "save" option, or figure out some way to do it
    in javascript.
    This has nothing to do with javascript. The server should send a
    "Content-Disposition: attachment; filename=foo.xm l" header.


    - Conrad

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Download an XML file from the server

      Conrad Lender wrote:
      On 2008-10-20 09:21, Jon Mcleod wrote:
      >I need to allow users to download and save XML files from the server to
      > their local client drive. [...] I either want the link to basically
      >present the user with a "save" option, or figure out some way to do it
      > in javascript.
      >
      This has nothing to do with javascript.
      Full ACK
      The server should send a "Content-Disposition: attachment;
      filename=foo.xm l" header.
      Content-Type: application/octet-stream

      is the more compatible solution.

      See also:
      <http://www.hanselman.c om/blog/TheContentDispo sitionSagaContr ollingTheSugges tedFileNameInTh eBrowsersSaveAs Dialog.aspx>


      PointedEaars
      --
      Anyone who slaps a 'this page is best viewed with Browser X' label on
      a Web page appears to be yearning for the bad old days, before the Web,
      when you had very little chance of reading a document written on another
      computer, another word processor, or another network. -- Tim Berners-Lee

      Comment

      Working...