Force Download - XML problem

Discussion in 'ASP .Net' started by PJS, Jul 18, 2003.

  1. PJS

    PJS Guest

    Thanks in advance.

    I have a site which generates a user specific XML document. The user then
    selects "Save to PC" which then forces the browser to show the
    "save/download" dialog box. The code used is as follows:

    Response.AddHeader("Content-Disposition", "attachment; filename=" &
    fileName)
    Response.ContentType = "text/XML"
    Response.WriteFile(fileName)
    Response.End()

    fileName is an XML document such as myXMLDoc.xml

    This works perfectly for later Operating systems such as Windows XP and
    Windows 2000 ( SP2 but not where SP1 is installed). The dialog box
    automatically recognises the file format as XML and saves the file
    correctly.

    Earlier Operating Systems fail to recognise the XML format and unless
    manually altered, save the file as a gobbly-glock text file.

    Is there a work around where I can force earlier systems to save an XML file
    as an XML file without the user having to manually enter the save as
    filename with the XML extension?

    With Thanks,

    Peter
    PJS, Jul 18, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Cox [Microsoft MVP]

    Re: Force File Download XML Problem

    Ken Cox [Microsoft MVP], Jul 19, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    692
  2. Miguel Dias Moura

    How to force download?

    Miguel Dias Moura, Apr 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    559
    Dan Brussee
    Apr 19, 2004
  3. localhost

    Force Download Not Working

    localhost, Jun 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    352
    Steven Cheng[MSFT]
    Jun 30, 2004
  4. gaubo79

    Force Download PDF Problem

    gaubo79, Dec 20, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    13,416
    giridhar86
    May 19, 2011
  5. Replies:
    0
    Views:
    372
Loading...

Share This Page