I read this tutuorial and tried it:
https://debugmode.net/2014/01/14/how-to-upload-file-in-node-js/
html:
<form action="/post-a-file" method="post" enctype="multipart/form-data" >
<input type="file" name="file" required>
</form>
app.js:
app.post("/post-a-file", function (req, res){
var destinationFile = fs.createWriteStream(__dirname + "/movies");
req.pipe(destinationFile)
req.on('end', ()=>{ console.log("end") })
})
but there is not a file in /movies
.