int len = imgLen.length();
byte [] rb = new byte[len];
InputStream readImg = new BufferedInputStream(
new FileInputStream(imgLen));
int index=readImg.read(rb, 0, len);
//st1.close();
response.reset();
response.setContentType("image/JPG");
response.setHeader("Content-disposition","attachment; filename=" +filename);
response.getOutputStream().write(rb,0,len);
response.getOutputStream().flush();
this was done in my jsp scrip-let code. When i run the page i am able to get save window with the filename. But the content not able to read .
Where i was done mistake and where i can change my code.
You should be doing this in a servlet. JSPs are meant as templates for text content, not images or other binary formats. Please read this article to understand what JSP is and why your approach is folly.