Display image from sql

前端 未结 5 575
星月不相逢
星月不相逢 2021-01-22 13:52

I\'ve create a table where I\'ve saved images through \"BLOB\". I need to show those images along with other items. But I don\'t know how to show those images together in the sa

5条回答
  •  爱一瞬间的悲伤
    2021-01-22 14:40

    Read the Blob data and write it into the file with header type image.. and try to print it, It should display the image file.

    And yes saving image or any file in DB is really a bad habit as you are increasing DB size and it slowdown the performance also.. I suggest you to just try to convert you Blob into Image but don't apply in your work. Just save the image at desired location and keep its location path into DB to fetch and save next time.

提交回复
热议问题