How to concat chunks of incoming binary into video (webm) file node js?
问题 I am trying to upload chunks of base64 to node js server and save those chunks into one file let chunks = []; app.post('/api', (req, res) => { let {blob} = req.body; //converting chunks of base64 to buffer chunks.push(Buffer.from(blob, 'base64')); res.json({gotit:true}) }); app.post('/finish', (req, res) => { let buf = Buffer.concat(chunks); fs.writeFile('finalvideo.webm', buf, (err) => { console.log('Ahh....', err) }); console.log('SAVED') res.json({save:true}) }); Problem with the above