Hi,
I have written a
servlet to download files(files in the my app. include .doc, .pdf, .xsl etc)
My code look similar to this:
response.setHeader("Content-disposition", "attachment; filename=fn" final ServletOutputStream outStream = response.getOutputStream();
final byte[] buffer = new byte[32768];
int n = 0;
while ( ( n = inputStream.read(buffer)) != -1)
{
outStream.write(buffer, 0, n);
}
in.close();
outStream.flush();
This works fine with Internet Explorer(IE 6) i.e., if the file is .doc or .pdf or .xsl then it automatically opens with corresponding applications.
The problem is with Mozilla firefox. firefox tries to open any attachment(.doc, .pdf, .xsl etc) with browser instead of opening with respective applications.
Is there anything we need to set in the servlet so that it knows how to open the attachment.
Thanks in advance