I am trying to decode base64 encoded string to video or image based on the type.
fs.writeFile(attachment_path, new Buffer(encodedString, "base64"), function(err) {
if(err)
{
return callback(err);
}
callback(null, 'perform_create');
});
It does not give any error and creates a file. The image files work fine but when I play a video file it gives an error Could not determine type of stream
. Can anyone tell me what am I missing here?