Uploaded multipart is undefined
- Dominant language
- JavaScript
- Stars
- 12.1k
- Forks
- 1.1k
- Avg merge
- 8d 2h
- Merged PRs (30d)
- 21
Description
I have tried using multer for uploading file and used Postman for testing endpoint. I have checked both header and name of file's attribute in form-data (which is the same both in the source code and Postman request).
```
import * as express from "express";
import * as multer from "multer";
const uploader = multer({
storage: multer.memoryStorage(),
limits: {
fileSize: 5 * 1024 * 1024, // keep images size < 5 MB
},
});
const router: express.IRouter = express.Router();
router.post("/upload",
uploader.single('file'),
async function (request: express.Request, response: express.Response) {
console.log("file",request.file);
console.log("files", request.files);
});
```
Contributor guide
Assessment
This issue has not been assessed yet.