aspose file tools*
The moose likes Servlets and the fly likes Convert and display  image from byte array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Convert and display  image from byte array" Watch "Convert and display  image from byte array" New topic
Author

Convert and display image from byte array

Red Ajnupez
Greenhorn

Joined: Sep 15, 2013
Posts: 1
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

Joined: Jan 10, 2002
Posts: 61766
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert and display image from byte array