I am storing files in SQL Server database as filestream datatype and it returns a blob. I am using nodejs with express. Is there a way to convert these blobs to images and send it to my ejs template using nodejs and express?
Asked
Active
Viewed 3,576 times
1 Answers
1
const blobToImage = (blob) => {
return new Promise(resolve => {
const url = URL.createObjectURL(blob)
let img = new Image()
img.onload = () => {
URL.revokeObjectURL(url)
resolve(img)
}
img.src = url
})
}

kira
- 26
- 4