Show image which is string coming from backend(Whole image) in React UI using <img />tag

Viewed 25

I have been working on the upload image and getting image from the backend. My backend is returning a full image as a string(not base64 FYI). Any idea how can I change the image string to image back? Thank you in advance.

What I tried -

  1. Setting this direct as

img src={imgString}

  1. Try to use btoa but not able to understand why it's not working.

enter image description here

1 Answers

Use <img src={url}>. Backend receives a GET request, you need only send image either as a stream via pipe, or as a string

Related