Receive Image data as JSON and injecting it into the DOM

后端 未结 3 441
有刺的猬
有刺的猬 2021-02-01 05:53

I am packaging an image into jSON and sending it to the client .... On the client side I wish to display this data as a image ...

I am not sending the Image URL via JSO

3条回答
  •  盖世英雄少女心
    2021-02-01 06:21

    I don't know how elegant your solution is, but you could encode the image as BASE64 and inline it using:

    
    

    It might also be noteworthy to say, that BASE64 encoding adds about ~33% overhead. Instead, you might create some temporary directory on your server, where you store such images and delete them after the request?

提交回复
热议问题