Answer the question
In order to leave comments, you need to log in
How to save a binary string to a file?
Good afternoon!
I get a binary file, convert it to a string:
let result = await rp(params); // request-promise
if (result) {
let file= new Buffer(result).toString('base64');
}
let file= new Buffer(stringBase64, 'base64').toString();
fs.writeFile(fileName, file, 'binary', (error) => {
if (error) {
throw error;
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question