Hi
I need a URL of binary data that is saved in database. So I can use it in API response which later can be used as "src" link. Something like we do in html e.g. <img src="">
P.S I am not going to use this link in outsystems app. It is going to be use externally. I am just exposing the api here with image as a URL
Not sure how you have structured your API, here is what I meant
REST API returning Image based on the provided Image Identifier
API consumed in sample HTML
This displays the image perfectly.
Hope it helps!
Junaid
Hi,
Please refer to below URL -
https://www.outsystems.com/forums/discussion/34673/getting-image-url-from-binary-data/#:~:text=You%20will%20build%20them%20by,in%20the%20BinaryData%20platform%20extension
Regards,
Rajat
Hi Syeda,
If I understand your situation correctly you already have the images stored as binary in your database. Now you want to expose those images through REST APIs. In that case the API endpoint url itself becomes the URL.
Okay got it. Thanks @Junaid Syed
Hi @Junaid Syed .As you said the api end point is my link.I need to use it something like this
But as can see no image is shown( I am testing through W3school).It is giving me response in the API but here it is not fetching it.
Please help me with this
Your API is returning data like "{"Photo":"iVBORw0KGgo...." which you cannot give as a source to img. This has to be in the format like "data:image/png;base64,iVBORw0KGgoAAAANS..." in order to render.
Thanks @Siya
Thanks @Junaid Syed. It works perfectly fine now