473,395 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Response.BinaryWrite question

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


Nov 19 '05 #1
0 1138

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Zam | last post by:
Hello World, Under Windows 2003 Server. IIS6. The following code working fine for small files, and for files with size about few megabytes. If I am trying to send HUGE file -- about 700...
5
by: katrinaVictim | last post by:
Question: I get the eror listed at the bottom of the post. What can I do to make the response of the x1.send a "binary" type? Or, in general, how can I just "make this work"? <%@...
3
by: spmm# | last post by:
Hi! My ASP.NET page gets a pdf-file from a SQLServer database and writes it in a browserwindow, using Response.BinaryWrite. It basically looks like this: public class WebForm1 :...
11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
1
by: Alex Nitulescu | last post by:
Hi. I have a WebService which provides a webmethod which returns a byte array representing a picture. The method's signature is: <WebMethod(Description:="Shows something nice every time !")>...
5
by: twiggy182 | last post by:
Hi, I really need you help because I'm not very familliar with ASP and I could not find any solution to my problem. To put you in situation, I have a CGI to which I send a file name, and that...
1
by: mattridings | last post by:
Hi gang, Have a script that works fine. However, it's really cpu intensive and I'm looking for suggestions on a) whether or not that's normal and if so b)a better way of doing it. Script is...
0
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, first question: shouldn't response.binarywrite be able to take my word doc that's stored in a binary field in my database and open it in word within the my browser? second question:...
1
by: .nLL | last post by:
hi everyone. i use asp to send files to users to prevent hotlinking and i always used following code Response.ContentType="video/3gpp" response.addheader "Content-Disposition",...
14
by: S N | last post by:
I am using the following code to hide the download url of files on my website. The code uses Response.Binarywrite to send file to the client. Kindly indicate the maximum size of the file that can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.