This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 64631
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