I'm setting up a new web application with React.js Node.js and MongoDB. I'm getting data from the client side which sends the data to the server side. On the server side, I'm creating a file that contains the data that was entered on the client side. Now I find it difficult to find to send the same file to Java code\class\file where there is a function that needs to get the same file and run a certain calculation. Anyone knows a way to do this?
router.post('/name',(req,res)=>
{
nameCounter++
const fileData = new Uint8Array(Buffer.from(req.body.byName));
fs.writeFile('byNameDataFile.'+nameCounter+'.txt', fileData, (err) => {
if (err) throw err;
console.log('byNameDataFile file has been saved!');
});
})
I need to send 'byNameDataFile'
to the Java file and run it with a specific function.