I have an service which returns the base64 version of an image. Now i want to use the base64 string in the src
tag of an img
. The service offers the ba
Data URI is a URI scheme, not an image file format. When you use src="http://..."
, the scheme is http
, not data
, the browser is expecting the response be an image, which means the response body should be the bytes of the image, not the base64 version.
so you can either: 1. just return the bytes of the image from the server instead of base64 2. use ajax to load base64 version from server, then set image's src attribute with it.