Download file from server
Hi
I am using this code thatI got from another post to download a file from server
final ServletOutputStream out = response.getOutputStream();
response.setContentType("application/octet-stream");
BufferedInputStream is = new BufferedInputStream(new FileInputStream(new File("c:/Test.png")));
byte[] buf = new byte[4 * 1024]; // 4K buffer
int bytesRead;
while ((bytesRead = is.read(buf)) != -1) {
out.write(buf, 0, bytesRead);
}
out.flush();
is.close();
out.close();
I am having these problems:
1. Instead of downloding the file, its displaying the file in the same page
2. there is no pop up to cofirm with user if user want to download the file or not
I am using struts (& weblogic).
Thanks in advance

