I'm trying to do the following:
upload a doc file to the a specific express route, and then use mammoth to parse it to an html object,
this is the library: https://www.npmjs.com/package/mammoth
My problem is that it takes the file in the documentation straight from the route, which is not what I want, I want to upload a file to my route and parse it...
router.post("/parseCV", (req, res) => {
console.log("entered route");
console.log(req.files);
});
Im uploading the file like that :
const onSubmit = e => {
e.preventDefault();
const formData = new FormData();
formData.append("file", file);
uploadImage(formData);
};
how can I access it in my route ? req.files,req.body are all undefined