posted 19 years ago
In our web based application we are using windows XP SP-2 and IE 6.0
When the user clicks on the link related to CSV File generation, the generated file is directly displayed in the browser, from where its link was clicked, with prompting the user with the download dialog box as to whether he wish to "Open" the file or "Save" it.
The function which takes care of the download is as below :-
.
.
.
response.setContentType(strContent);
if (strFileType.equals(LCConstants.ACTION_XML))
{//if it is XML
response.setHeader("Content-Disposition",
"attachment;filename="+strFileName+".xml");
out = response.getOutputStream();
}
else
{//if it is CSV
response.setHeader("Content-Disposition",
"inline;filename="+strFileName+".csv");
out = response.getOutputStream();
}
out.println(strXMLOrCSV);
ByteArrayOutputStream byteStream=new ByteArrayOutputStream();
byteStream.writeTo(out);
byteStream.flush();
byteStream.close();
}//end of download()
The above code works fine for windows 2000.
If in the above code "inline" is changed to "attachment" then, it works fine in windowz XP but in window 2000 it pops up the download dialog box twice.
While I know about the "Confirm open after download" and "Browse in same
window" options that I can set for the file types,
is there any way to force IE to always ask to Open/Save a file, regardless of the extension?
can abody plz share their knowlegde with me.
Thank you.
Regards,
Sheetal...