Answer the question
In order to leave comments, you need to log in
How to save base64 to file in nodeJS as image or video?
The server receives the base64 from which to get the image or video and save it.
Current code:
for (let i = 0; i < length; i++) {
let buff = new Buffer(content[i], 'base64')
fs.writeFileSync(`${pathArr[i]}`, buff, function(err) {
consola.error({ message: err.message, badge: true })
work.remove()
return res.status(400).json({ message: 'Запись не удалась' })
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question