I have node js application which uses express and express-fileupload.
I created such post mapping to accept file like this:
app.post("/upload", async (req, res) => {
if (!req.files) {
return res.status(400).send("No files were uploaded.");
}
var file = req.files.uploadedFileName;
});
And this file object contains:
{
name: 'all_payments.txt',
data: <Buffer d0 a1 d0 b5 d0 ba d1 86 d0 b8 d1 8f d0 94 d0 be d0 ba d1 83 d0 bc d0 b5 d0 bd d1 82 3d d0 9f d0 bb d0 b0 d1 82 d0 b5 d0 b6 d0 bd d0 be d0 b5 d0 9f d0 ... 4411 more bytes>,
size: 4461,
encoding: '7bit',
tempFilePath: '',
truncated: false,
mimetype: 'text/plain',
md5: 'e07f9aa0117f40db9035a6d807b4b6e7',
mv: [Function: mv]
}
I need to send this file as FormData to another application running on port 8080. Unfortunately I am bad at node js and express, please help me to solve this. If there is another file reading library to address this let me know. Thanks in advance.