Response.BinaryWrite question

T

Thomas Satzinger

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top