3 Replies Latest reply on Jan 16, 2018 8:44 PM by Luke Beacon

    PreviewImage of 'View' from Rest API - Broken Image

    Matthew Hogetvedt

      Hello everyone,

       

      I'm attempting to retrieve a preview image from a view that comes from my company's Tableau server. I'm able to successfully grab the image using the program "Postman", however when I try to do this through a web service in JavaScript/AngularJS my response body appears to be in binary/hex.

       

      Ok - no problem. I run the response through a Base64 converter and get the converted string. However when I put this converted base64 string into http://codebeautify.org/base64-to-image-converter, I get a broken image. Likewise, when I attempt to convert the response in JavaScript and place it into an ng-src tag (while also utilizing data:image/PNG;base64, and enabling all of the filters that comes with it), I get a broken link.

       

      My question is this - what exactly is my response payload? Is it a binary file of a PNG? If so, how would you recommend I go about converting it into an actual image? Or have I errored in one of my steps to decode the image?

       

      Thanks for reading,

       

      Matt