• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display BLOB contents to the client

 
Ramesh Bhagasra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display the blob contents in the clients window and give him the option either to open or save the contents. I am able to read the contents from Oracle Blob Field and stored the contents in the ByteArrayOutputStream object but I am not able to open the contents for the client. I am using the following code
Blob blob = resultSet.getBlob(1);
int length = (int)blob.length();
byte [] b = blob.getBytes(1, length );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write(b,0,length);
response.setHeader("Content-Disposition","attachment; filename="+baos );
Please help me
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sort of thing comes up all the time - browse the last few weeks of post or do a search for BLOB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic