Skip to content

Instantly share code, notes, and snippets.

@rvagg
Forked from milovanderlinden/gist:3523940
Created August 30, 2012 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvagg/3523962 to your computer and use it in GitHub Desktop.
Save rvagg/3523962 to your computer and use it in GitHub Desktop.
function getTempImg(base64Image, filename, callback) {
var decodedImage = new Buffer(base64Image, 'base64');
var filename = 'cache/' + filename + '.jpg';
fs.writeFile(filename, decodedImage, function(err, data) {
console.log(data);
if (err) return callback(err);
callback(null, filename);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment