title: How to send response to client when files is too large with Multer
body: <p>I'm using NodeJs <a href="https://github.com/expressjs/multer" rel="noreferrer">Multer</a> to upload files. I need to send response back to a client when file user tries to upload is too large. The problem is that <code>onFileSizeLimit</code> only has file as argument and I dont know how to send response to client. What I need to do is basically soomething like below:</p>
  
  <pre><code>app.use('/users/gyms/upload-logo', multer({
      // other settings here then:
      onFileSizeLimit: function (file) {
          // but res (response) object is not existing here
          res.json({
              message: "Upload failed",
              status: MARankings.Enums.Status.FILE_TOO_LARGE
              // status: -6
          });
      }
  });
  </code></pre>
  
  <p><code>res</code> object dosent exists in there however and I'm wondering what is the best way to send some sort of response to client.</p>