I am trying to write code that will download text for the user. I do this by changing the content-type to anything and then setting the filename to use. In Netscape this works perfect, in Internet Explorer this doesn't work at all.
I get the message: "Internet exploer cannot download from the internet site".
Here is the code I have in pageReqestBegin (I also tried in a Servlet with the same result).
Any help would be much appreciated!
OutputStream out;
String fileName;
String content = "Hello\n";
byte[] data;
PrintWriter printWriter = res.getWriter();
res.setContentType("application/junk"
;
res.setContentLength(content.length());
fileName = "test.txt";
res.setHeader("Content-Disposition", "inline; filename=\""
+ fileName + "\""
;
printWriter.write(content);
printWriter.flush();
I get the message: "Internet exploer cannot download from the internet site".
Here is the code I have in pageReqestBegin (I also tried in a Servlet with the same result).
Any help would be much appreciated!
OutputStream out;
String fileName;
String content = "Hello\n";
byte[] data;
PrintWriter printWriter = res.getWriter();
res.setContentType("application/junk"
res.setContentLength(content.length());
fileName = "test.txt";
res.setHeader("Content-Disposition", "inline; filename=\""
+ fileName + "\""
printWriter.write(content);
printWriter.flush();