posted 15 years ago
try this code.
try {
StringBuffer fileHeader = new StringBuffer();
fileHeader .append("inline");
fileHeader .append("; filename=");
fileHeader .append("file.jpeg");
if(pdfBytes!=null && pdfBytes.length>0) {
response.setHeader("Cache-Control", "max-age=30");
response.setContentType("image/jpeg");
response.setHeader("Content-disposition", fileHeader .toString());
response.setContentLength(imageBytes.length);
response.getOutputStream().write(imageBytes, 0, imageBytes.length);
} else {
response.getOutputStream().print("
No File Found Related Client.");
}
} catch (Exception e) {
e.printStackTrace();
}