Closed okpyard closed 2 years ago
Hi,
your code is working just fine, ensure that you're correctly using postman (it seems correct from the image), if you're still facing this issue, please share your express and express-fileupload version
"express": "^4.17.3",
"express-fileupload": "^1.3.1",
Mine is this, and I am getting the same error. It was working fine 1 week ago.
@nischay2x @Okpyard Remove the file from the body request in Postman and add it again. It is a known bug that hasn't been solved yet.
I'm having the same issue and it's not working for postman. I tried removing and adding the file field but still not working..
I use this code `const express = require('express') const app = express() const port = 3000 const fileupload = require("express-fileupload"); app.use(fileupload());
app.post("/", (req, res) => { if (!req.files) { res.send("File was not found"); return; }
const file = req.files.file; res.send(
${file.name} File Uploaded
); });app.listen(port, () => { console.log(
Example app listening at http://localhost:${port}
) })`but req.files is undefined