Skip to content
Advertisement

To display a Base64 image in AngularJS

I have inserted a Base64 image to a database using this Java code:

JavaScript

But if I try to display the image in AngularJS using it, it is not displaying the image. In SQL Server I have saved my image as varbinary(max) and in AngularJS code,

JavaScript

But I am getting only bytes with a message like this:

JavaScript

Where am I going wrong? The image is in PNG format.

Advertisement

Answer

In POJO I made changes for byte[] and it worked. I have datatype with String and modified to byte[] but Base64 images didn’t displayed but t is displaying only byte array images.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement