boohyabuddha
New Member
I have an upload control that calls a handler from the client and is to send back a string of xml to the client. The code below works fine in chrome but is sending weird xml back to the client in IE.Handler Code:\[code\] public void ProcessRequest(HttpContext context) { if (context.Request.Files.Count > 0) { //context.Response.ContentType = "application/xml"; string path = context.Server.MapPath("~/TempUploads"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } var file = context.Request.Files[0]; string fileName; if (HttpContext.Current.Request.Browser.Browser.ToUpper() == "IE") { string[] files = file.FileName.Split(new char[] { '\\' }); fileName = files[files.Length - 1]; } else { fileName = file.FileName; } string strFileName = fileName; fileName = Path.Combine(path, fileName); file.SaveAs(fileName); string msg = File.ReadAllText(fileName); File.Delete(fileName); context.Response.Write(msg); } }\[/code\]The XML string debugged from handler before sent to client (which looks correct)\[code\]<?xml version="1.0"?> <ApplicationData> <DataElement name="Comments" type="String"></DataElement> <DataElement name="ModAuthor" type="String"></DataElement> <DataElement name="CreateDate" type="Datetime"></DataElement> <DataElement name="Author" type="String"></DataElement> <DataElement name="StatusDate" type="Datetime"></DataElement> <DataElement name="StatusDisp" type="String"></DataElement> <DataElement name="Status" type="Number"></DataElement> <DataElement name="Approved" type="Number"></DataElement> <DataElement name="Submitted" type="Number"></DataElement> <DataElement name="LogNumber" type="Number"></DataElement> </ApplicationData>\[/code\]Then XML string that is being sent back is:\[code\]<DIV class=e><SPAN class=b> </SPAN> <SPAN class=m><?</SPAN><SPAN class=pi>xml version="1.0" </SPAN><SPAN class=m>?></SPAN> </DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em" class=c><A class=b onfocus=h() onclick="return false" href="http://stackoverflow.com/questions/14074431/#">-</A> <SPAN class=m><</SPAN><SPAN class=t>ApplicationData</SPAN><SPAN class=m>></SPAN></DIV><DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>Comments</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>String</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>ModAuthor</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>String</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>CreateDate</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>Datetime</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>Author</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>String</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>StatusDate</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>Datetime</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>StatusDisp</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>String</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>Status</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>Number</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>Approved</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>Number</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV class=e><DIV style="TEXT-INDENT: -2em; MARGIN-LEFT: 1em"><SPAN class=b> </SPAN> <SPAN class=m><</SPAN><SPAN class=t>DataElement</SPAN> <SPAN class=t>name</SPAN><SPAN class=m>="</SPAN><B>Submitted</B><SPAN class=m>"</SPAN><SPAN class=t> type</SPAN><SPAN class=m>="</SPAN><B>Number</B><SPAN class=m>"</SPAN><SPAN class=m> /></SPAN> </DIV></DIV><DIV><SPAN class=b> </SPAN> <SPAN class=m></</SPAN><SPAN class=t>ApplicationData</SPAN><SPAN class=m>></SPAN></DIV></DIV></DIV>\[/code\]For some reason from the XML is getting translated to the client in a totally different format.