I am trying to convert Blob to a File object in nodejs. The Blob is passed from my frontend to my backend. I then want to convert it in my backend.
Here is my current code:
frontend
var data = {
"file": file, //this is blob
"file_name": bucket_string
};
return await axios.post(`/files/upload-file`, data);
backend
const file = new File(data['file'], "tests/" + customer + "/" + sound + ".wav");
Currently this throws an error:
ReferenceError: File is not defined
How can I properly convert the data in nodejs?