Created
March 6, 2014 14:32
-
-
Save jeonghwan-kim/9391056 to your computer and use it in GitHub Desktop.
usage base64 in nodejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs.readFile(image_origial, function(err, original_data){ | |
fs.writeFile('image_orig.jpg', original_data, function(err) {}); | |
var base64Image = original_data.toString('base64'); | |
var decodedImage = new Buffer(base64Image, 'base64'); | |
fs.writeFile('image_decoded.jpg', decodedImage, function(err) {}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment