This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert and display image from byte array

 
Red Ajnupez
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method from a webservice that returns a bytearray that is an image and i want to display this as a response.

I tried create a jpg file and then display it but this doesn't work. The file is created but i cant displayed it.

.

Does anyone know how to do this?


Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to return the image as the response, why are you writing HTML?

Do you want to return the image as the response? Or return an HTML page that contains the image?

I assume the former, but your code is trying to do the latter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic