I have a servlet that sends a file by setting the HTTP Content-Type to "application/zip", the Content-Disposition to "attachment" and writing it on the response's OutputStream; it behaves correctly when deployed on my local application server, making the browser show the popup to choose wheter or not to download the file.
However, when deploying on a clustered jboss server, IE hangs on 0% requesting file information for the whole transfer and then fails with an error message stating that the file wasn't available for download: even stranger is the fact that with FF and Chrome the servlet behaves correctly, i.e. same way as on localhost.
Any clues?
I can also provide a small snippet of the significant part of the servlet code:
response.setContentType("application/zip; name=" + f.getName());
response.setContentLength((int)f.length());
response.addHeader("Content-Disposition", "attachment;filename=" + f.getName());
byte[] buf = new byte[1024];
int bytesRead;
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f));
OutputStream os = response.getOutputStream();
while((bytesRead = bis.read(buf)) != -1) {
os.write(buf, 0, bytesRead);
}
os.flush();
bis.close();
I don't really know if the problem lies in my servlet code or in the clustered server configuration, but i'm starting to guess the second chance may be the right one...any ideas on what could be wrong in my cluster configuration?