How to limit the file size when uploading with multer?

There is no onFileUploadStart with the new multer API. If you want to limit the file size, you should instead add limits: { fileSize: maxSize } to the object passed to multer():

var upload = multer({
  storage: storage,
  limits: { fileSize: maxSize }

Leave a Comment