FileManager.uploadFileToS3(req.file('file'), function(err, uploadedFiles) {
if (err) {
//...
}
server.post("/uploads", (req, res) => {
new formidable.IncomingForm()
.parse(req)
.on("file", function(name, file) {
console.log("Got file:", name);
})
.on("field", function(name, field) {
console.log("Got a field:", name);
})
.on("error", function(err) {
next(err);
})
.on("end", function() {
res.end();
});
});