How can I save a base64-encoded image to disk?

I think you are converting the data a bit more than you need to. Once you create the buffer with the proper encoding, you just need to write the buffer to the file. var base64Data = req.rawBody.replace(/^data:image\/png;base64,/, “”); require(“fs”).writeFile(“out.png”, base64Data, ‘base64′, function(err) { console.log(err); }); new Buffer(…, ‘base64’) will convert the input string to a … Read more

Managing large binary files with Git

I discovered git-annex recently which I find awesome. It was designed for managing large files efficiently. I use it for my photo/music (etc.) collections. The development of git-annex is very active. The content of the files can be removed from the Git repository, only the tree hierarchy is tracked by Git (through symlinks). However, to … Read more

How can you encode a string to Base64 in JavaScript?

You can use btoa() and atob() to convert to and from base64 encoding. There appears to be some confusion in the comments regarding what these functions accept/return, so… btoa() accepts a “string” where each character represents an 8-bit byte – if you pass a string containing characters that can’t be represented in 8 bits, it … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)