You need to sign in to do that
Don't have an account?

Display an image retrieved from a REST webservice
Hello,
I want to display a .TIF image retrieved from a REST web service. I do not want to have it downloaded.
The basic setup/flow is:
Thanks, Chris
I want to display a .TIF image retrieved from a REST web service. I do not want to have it downloaded.
The basic setup/flow is:
- Call java service method that returns a .TIF image. Since I'm also updating the service, I'd like to know the ramifications between using @Produces({ "image/tif" }) and @Produces({ "application/octet-stream" }). I was also going to use 'Content-Disposition", "inline'
- The above service would be called using an ActionFunction on the VF page and then the controller would call the service.
- The result of the call would be a Blob object, which I would then convert to a Base64 encoded string to set on the controller.
- The above ActionFunction would also have a rerender tag to rerender an image on the page with a data url and the Base64 string from the controller.
Thanks, Chris
Hi Chris,
In my VisualForce page, I retrieve the image with the click of a button, but you could do the same with an actionfunction.I've faced the same challenge a few months ago. This is how I solved it:
(this is a simplified example, you will have to fill in the details yourself)
I hope this helps!
Happy coding!
Best regards,
Martijn Schwärzer
Thanks so much for your reply.
For the service you were calling, what was the content type of the
data being returned ? image/png ? application/octet-stream ?
Thanks again
Chris
In my case it returned image/png.
Regards,
Martijn Schwärzer