Hi, I'm trying to convert an image binary data to a URL to be used in an external API that only accepts URLs. Is there a way or a forge API to do that conversion, I've searched everywhere and only found ones capable to do binary to base64 conversion.
Thanks
Hi Miguel,
Currently seen the same, I didnt found any relevant forge component. if you go with development so following bellow step
Create an Image Entity. Add an attribute Content of type Binary Data; Add an attribute Filename of type Text; Add an attribute MimeType of type Text;
Create a WebScreen called FetchImage. Add an Input Parameter ImageId of type Image Identifier; Add a Preparation.
You will build them by starting the URL with data:image/<format>;base64, and then appending the contents of the image (after converting the binary content to base64 you can find this functionality in the BinaryData platform extension)
you can refer this https://stackoverflow.com/questions/11106781/decoding-base64-images
Note that depending on the API, it might very well reject such a URL with the image data included, in which case you need to serve the image via an actual URL. You could check my article over on Medium for an approach.