Actually, when i upload the file i store directly in DB (BLOB). When I download I'm getting data in bytes that I pass to ServletOutputStream.
ServletContext context = servlet.getServletContext();
String contentType = context.getMimeType(docName);
if (contentType != null) {
response.setContentType(contentType);
} else {
response.setContentType("application/octet-stream");
}
response.setHeader("Content-Disposition", "attachement; filename=" + downloadFile + ";");
byte []data = actualData;
response.setContentLength(data.length);
OutputStream servletoutputstream = response.getOutputStream();
servletoutputstream.write(data);
within method it doesn't throw any error..but at this moment Download dialog is not popped up....and finally I end-up with one JSPException....
I want to know when this Dialog should be popped up? And above code is correct for downloading data?
-bhavin