multer icon indicating copy to clipboard operation
multer copied to clipboard

TypeError: Cannot read properties of undefined (reading 'call')

Open wandersonDeve opened this issue 2 years ago • 1 comments

const storage = diskStorage({
  destination: function (req, file, cb) {
    cb(null, '/tmp')
  },
  filename: function (req, file, cb) {
    const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1E9)
    cb(null, file.fieldname + '-' + uniqueSuffix)
  }
})
const upload = multer({ storage });
routes.post("/upload_file", upload.array('photos', 12), ShopController.uploadFile);

How do I solve this problem? Node 16.13.1 Express and Javascript

const upload = _multer.multer.call(void 0, { storage });
                              ^

TypeError: Cannot read properties of undefined (reading 'call')

wandersonDeve avatar Apr 18 '22 00:04 wandersonDeve