i got this code, i already know that data is correct,
i try to send the base64 string to the client without the preFix of
'data:image/jpg;base64,'
but i think i dont have the correct headers that will show the image, where ever i try it's don't work without the preFix,
app.get('/image', async (req, res, next) => {
let data = img.toString('base64');
let length = data.length;
res.header('Content-Type', 'image/jpg');
res.header('Content-Length', String(length));
res.send(data); //without 'data:image/jpg;base64,'
})
i want that in the client all i will need to do is - img.src = http.get('/image')
anyone, help? thanks