quick question here, I'm pretty confident this is not complicated and a lot of chance that is a duplicate but I still cannot find a way to do it.
I'm in the backend and the front end return send me a cdv file in the body. I cannot change that.
What I need to do is simply parse it but this is the trick. I can't "open" the given data to have something to work with cdv-parse.
the format of the data is (when I do a console.log): data:text/csv;name=toto.csv;base64,VHlwZSBk (and so on)
console.log(myfile); // data:text/csv;name=toto.csv;base64,VHlwZSBk (and so on)
console.log(fs.readFileSync(myfile, "base64"), "base64")); // error: ENOENT: no such file or directory, open 'u�Z��m�
I also tried with ```Buffer.from(myfile, "base64").toString()`` and again the format isn't the data expected.
EDIT: it seem that using myfile = myfile.replace("data:text/csv;name=toto.csv;base64,", "");does the trick with buffer.from().toString();
but I want something more générique, I guess something exist no ?
Thanks in advance