This repository was archived by the owner on May 14, 2025. It is now read-only.
This repository was archived by the owner on May 14, 2025. It is now read-only.
req.files empty on nodejs 14 #29
Closed
Description
I have a feeling this might be a nodejs 14 issue, maybe related to nodejs/node#33050 not sure.
Same code works on node 12.x. On nodejs 14 req.files is just an empty object. Simple app to reproduce below.
const express = require('express')
const path = require('path')
const multi = require('connect-multiparty')
const multiMiddleware = multi();
const app = express()
const port = 3000
app.get('/', (req, res) => res.sendFile(path.resolve(__dirname, './index.html')))
app.post('/upload', multiMiddleware, function (req, res) {
console.log('got upload', req.files);
res.send('ok');
});
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))