469,950 Members | 2,141 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

I try to send an xml from an aspx pages which generate an xml file. And I tried with this method

Hello,

I try to send an xml from an aspx pages which generate an xml file.
And I tried with this method
FileStream fs = new
FileStream(WebSdxResponse.file_path,FileMode.Open, FileAccess.Read,FileSh
are.None);
byte[] b = ReadFully(fs,(int) fs.Length);Response.Clear();
Response.ContentType= text/xml;
Response.AppendHeader("content-disposition","attachement;filename=test.x
ml");
Response.OutputStream.Write(b,0,b.Length);
Response.End();
Response.Close();
Orig: xml format, I sure the xml format is well formatted.

In my Internet explorer, I have some extra characters (_ViewState, html
tags). But when I change the ContentType(blabla/bXml) and change
filename to test.Dxml. It works well.
Could help me to send an xml page well formatted in internet explorer?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 1357
zoltix wrote:
Hello,

I try to send an xml from an aspx pages which generate an xml file.
And I tried with this method
FileStream fs = new
FileStream(WebSdxResponse.file_path,FileMode.Open, FileAccess.Read,FileSh
are.None);
byte[] b = ReadFully(fs,(int) fs.Length);Response.Clear();
Response.ContentType= "text/xml";
Response.AppendHeader("content-disposition","attachement;filename=test.x
ml");
Response.OutputStream.Write(b,0,b.Length);
Response.End();
Response.Close();
Orig: xml format, I sure the xml format is well formatted.

In my Internet explorer, I have some extra characters (_ViewState,
html tags.). But when I change the ContentType("blabla/bXml") and
change filename to test.Dxml. It works well.
Could help me to send an xml page well formatted in internet explorer?


You are sending this from the codebehind of an aspx page?
Did you clear all html code out of that aspx file?

By the way, the content-disposition is "attachment", in your post you
add en extra "e" in the middle (might be a typo in the post)

Hans Kesting
Nov 16 '05 #2


zoltix wrote:
Hello,

I try to send an xml from an aspx pages which generate an >xml file.
And I tried with this method
FileStream fs = new

FileStream(WebSdxResponse.file_path,FileMode.Open ,FileAccess.Read,FileS h are.None);
byte[] b = ReadFully(fs,(int) fs.Length);Response.Clear();
Response.ContentType= "text/xml";

Response.AppendHeader("content-disposition","attachement;filename=test. x ml");
Response.OutputStream.Write(b,0,b.Length);
Response.End();
Response.Close();
Orig: xml format, I sure the xml format is well formatted.

In my Internet explorer, I have some extra characters >(_ViewState,
html tags.). But when I change the >ContentType("blabla/bXml") and
change filename to test.Dxml. It works well.
Could help me to send an xml page well formatted in >internet explorer?
You are sending this from the codebehind of an aspx page?
Did you clear all html code out of that aspx file? By the way, the content-disposition is "attachment", in >your post you
add en extra "e" in the middle (might be a typo in the >post) Hans Kesting



In fact, it is a button on my Aspx page which generates a stream. This
issue is only with the xml format. For a others format, they work well
(Exe,Zip.). I am going to try to add an aspx page just for the
downloading and I hope that I will resolve my problem
But I dont understand why with the xml formats(Ext(.xml) or
Type(Text/Xml)) only, it dont work?

Thank a lot


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mark J. McGinty | last post: by
9 posts views Thread by eswanson | last post: by
29 posts views Thread by John Rivers | last post: by
4 posts views Thread by orianavim | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.