response.setHeader in IE

Hi All,

I am trying to develop an web application java, thru which i can download an xml file.

My code is working fine in FireFox. But the same code is not working in IE 6 & 7, the file contents are displaying in the browser itself. I am not getting any download option.

Here is my code

response.setContentType("application/xml");

response.setContentType("application/x-download");
response.setHeader("Content-Disposition", "attachement; filename="+ backupFileName);


OutputStream os = response.getOutputStream();
try
{
File fileToDownload = new File(backupFileName);
FileInputStream fileInputStream = new FileInputStream(fileToDownload);
System.out.println("inputStream is called");
int i = 0;
System.out.println("before writing");
while ((i = fileInputStream.read()) != -1) {
os.write(i);
}
fileInputStream.close();
System.out.println("file is written n closed and redirected is false");
redirected = false;

}
catch (FileNotFoundException fnfe)
{
System.out.println("FileNotFoundExcpetion"+fnfe.getMessage());
}

In the following urlhttp://forum.java.sun.com/thread.jspa?messageID=4284031

I had seen that it is a bug is IE 6. How can I resolve my problem.

can u guys plz help me out to fix this problem.

regards,

krish

[1634 byte] By [ksrk] at [2008-2-22]
# 1

Per the support engineer team:

After careful examination of this issue we are of the opinion that this is something to do with JAVA and not with any Microsoft product, since his code is working with Firefox but not with IE. They might have to modify their “JAVA” code to make it compatible with IE 6 or IE 7.

-brenda (ISV Buddy Team)

MSISVBuddyTeam at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Partnering with Microsoft...
# 2
Content Headers are not Java specific. I would like to know how much money every day Microsoft costs the American economy in lost productivity
WillSBoston at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Partnering with Microsoft...