multer – req.file always undefined

In case of postman, try following:

  1. Close the postman tab for the API
  2. Open a new tab again
  3. Rebuild the API request and then send.

This may fix the problem. Every time you restart the server you need to do above steps for calling the API again. The reason being multer sends back some cookies called connect.sid to the client which it may require in further communication. Using old cookies will not upload the file.

Leave a Comment