Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: HELP: Servlet File Download solution.

Shanta B

2004-01-14


Hi

  I had similar type of problem on windows 8 months ago .... We installed
patch for IE5.x ....I can not remember exactly ....its better to look into
microsoft site.


-----Original Message-----
From: Rai Ou
To: 'Tomcat Users List'
Sent: 14/01/2004 8:14 AM
Subject: HELP: Servlet File Download solution.

I wrote a download servlet but I found it didn't run at IE5.x

IE6.x - OK
IE5.x - NG
NS - OK

My source is below. I want to know if there are better solutions
or any Common Libarary I can use.

response.setHeader("Content-Disposition",
"attachment; filename=\"" + myFileName + "\"");
response.setContentType("application/octet-stream;
name=\"" + myFileName + "\"");
String f = myFilePath;
PrintWriter out = response.getWriter();
BufferedReader in
  = new BufferedReader(new FileReader(f));
String line;
while ((line = in.readLine()) != null) {
 out.println(line);
}
in.close();

Thanks.
Rai



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.