req.files empty on nodejs 14
See original GitHub issueI have a feeling this might be a nodejs 14 issue, maybe related to https://github.com/nodejs/node/issues/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}`))
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:37 (14 by maintainers)
Top Results From Across the Web
Express and Multer upload issue - req.files is always empty
My express form processing req.files giving me empty array or object for all the strategy i have tried. and my file field is...
Read more >How to handle file upload in Expressjs - Educative.io
Step 1: Initiate the project. mkdir uploader && cd uploader npm init -y. The first line creates an empty directory and moves into...
Read more >File uploads using Node.js - CodeForGeek
File upload in node.js seems tedious due to its async nature and network ... After completing upload , req.files variable holds following array...
Read more >Express multer middleware
Accept an array of files, all with the name fieldname . Optionally error out if more than maxCount files are uploaded. The array...
Read more >Errors | Node.js v19.3.0 Documentation
Error: Things keep happening! at /home/gbusey/file.js:525:2 at ... ENOTEMPTY (Directory not empty): A directory with entries was the target of an operation ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @julianlam , @sw360cab , and everyone, sorry for the lack of updates; some life events occurred and I just got back into GitHub / open source things a couple days ago. I pretty much have all the fixes ready for this, and just working to get them published out asap. I am setting myself a timeline for this particular issue to be done by this weekend, if that helps.
@dougwilson can you bump the version to force the upgrade?