Set img src from Byte Array
Replace the jpg
with the type of image, and [your byte array]
with your byte array
. You need to convert it to base64
if it isn't already.
<img id="profileImage" src="data:image/jpg;base64, [your byte array]">
In my case the base64 byte array had to be chunked, in the way:
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QCARXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA
AAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAOQAAAH
...
To make this solution works.