How to do Base64 encoding in node.js?2) I was saving base64 encode to file in C and reading it from NodeJS. The problem is saving to file adds addition characters which make problem in decoding it using NodeJS (Always get the corrupted zip) UTF8 problem. Im sending the contents of this Flex form (Dont ask why) over to node. There is a post paramteter called "photo" which is a base64 encoded image. Contents of photo get sent over ok. Problem is when I am trying to decode the content and write them to a file. Node.js base64 encode a downloaded image for use in data URI.node.js: merge 2 images side by side and save it back. Using HTML5 on nodejs and Images. Node.js Base64 Image decoding and writing to file. Save the following code in a file "encode-text.js".Decoding Base64 Strings with Node.js.