Open ghost opened 9 years ago
Hi, I solve the issue with the following work arround.
rows[i].image(function(err, name, eventEmitter) {
let buffers = [];
eventEmitter.on('data', function(chunk) {
buffers.push(chunk);
});
eventEmitter.on('end', function() {
let buffer = Buffer.concat(buffers);
await fs.writeFile(fileName, data, async function (err) {
if (err) {
console.log(err);
} else {
// here you already have the imagem on the path(fileName)
}
});
});
});`
there are another options here: https://stackoverflow.com/questions/46574826/firebird-blob-to-base64-node-js, but this on solve the issue. In the event on.('data', ) was calling several times, because the file was big. then it was necessary to "mount" first, and after when the event 'end' was called, you need just concact the array.
I would like to convert sequentially selected blob subtype 0 files from Firebird DB to base64 string and convert this base64 string to image files.
When I was running my code, I got these errors:
Any suggestions?