How to display base64 encoded image in HTML if it is located in a separated file?

后端 未结 4 972
悲哀的现实
悲哀的现实 2020-12-14 12:02

I have base64 encoded image. If I put it right into html it works:


But when I put all that b

4条回答
  •  情歌与酒
    2020-12-14 12:42

    You can simply take on server side approach and just print the file into the src part of the img tag like so:

    Where your image.txt contains i.e.: data:image/png;base64,...

提交回复
热议问题