Response.BinaryWrite question

Discussion in 'ASP .Net' started by Thomas Satzinger, Jun 12, 2005.

  1. Hi to all.

    I am using the follwonmg code to download from an internal XmlDocument to
    the client file system:

    XmlDocument _doc ; // has some contents

    _doc.PreserveWhitespace = true;

    byte[] _bArr;

    System.Text.UnicodeEncoding uniEncoding = new System.Text.UnicodeEncoding();

    String _sXml = _doc.OuterXml;

    _bArr = uniEncoding.GetBytes(_sXml);

    Response.ClearContent();

    Response.ClearHeaders();

    Response.AddHeader("ContentType","application/octet-stream");

    Response.AddHeader("Content-Disposition", "attachment;
    filename=filter.flt");

    Response.BinaryWrite( _bArr );

    Response.End();





    It works pretty wee as far as i have ssen.

    Only one thing i do not know how to solve



    The file-save dialog shows a file type HTML document.

    When i save it, i get a filter.flt.htm document.

    How can i convince my app to save a filter.flt document per default.





    Thanks

    Thomas
     
    Thomas Satzinger, Jun 12, 2005
    #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. DAC
    Replies:
    1
    Views:
    2,295
    Steve C. Orr, MCSD
    Jul 31, 2003
  2. =?Utf-8?B?QnJhZCBSb2JlcnRz?=

    RE: Response.BinaryWrite or something causes multiple posts

    =?Utf-8?B?QnJhZCBSb2JlcnRz?=, Aug 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    575
    =?Utf-8?B?RGFuIEM=?=
    Aug 19, 2004
  3. spmm#

    Response.BinaryWrite question

    spmm#, Nov 3, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    9,602
    rdevalco
    Mar 23, 2013
  4. Alex Nitulescu

    Response.BinaryWrite question, please

    Alex Nitulescu, Feb 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,465
    William F. Robertson, Jr.
    Feb 15, 2005
  5. Replies:
    1
    Views:
    862
Loading...

Share This Page