Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem showing an image from database

 
Evaristo Ballorca
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody, i've a problem and i don't know where is it. I want send ti the client a image loaded from a database( SAP DB ). In the database the image is save like a LONG BYTE column. When a receive a request for a image i make a select to the database and i load the byte array in a bean. Then a send the byte to the cliente in ths way:


byte[] abData = bean.getData();
resp.setContentType( "image/jpeg" );
resp.setContentLength(abData.length);
resp.getOutputStream().write( abData );
resp.getOutputStream().close();


It doesn't work If i do this with a image in the server file system it work. I don't know where is the problem.

Thanks.
[ June 27, 2004: Message edited by: Michael Ernest ]
 
Evaristo Ballorca
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's work fine. The problem was in the way that a read the file from the request and i save it in the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic