I have written a controller in spring boot for getting image of particular user and i am returning it in form of byte array
@GetMapping(value = "/images/{id}/{login}",produces = {MediaType.APPLICATION_OCTET_STREAM_VALUE})
public byte[] getImage(@Valid @RequestParam("id") String id,@RequestParam("login") String login)
throws IOException, XmlPullParserException, NoSuchAlgorithmException, InvalidKeyException, InvalidArgumentException, ErrorResponseException, NoResponseException, InvalidBucketNameException, InsufficientDataException, InternalException {
return IOUtils.toByteArray(fileService.getImage(id, login));
}
Is there a method in angularjs so that i could convert it in form of image So that i could display the profile Picture of User
<img src="/path/mapped/to/controller/method" />.<img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." />