title: Express.js and multer: how to know when the files are all uploaded?
body: <p>I'm using Multer module for file uploads. While it all works ok, there's a warning at the end of their github page, which reads:
  "WARNING: req.body is fully parsed after file uploads have finished. Accessing req.body prematurely may cause errors."</p>
  
  <p>This has got me really worried. I just can't find a way to let the .post middleware know when the file(s) have been uploaded and req.body is ready to use. Here's my code:</p>
  
  <p>app.js:</p>
  
  <pre><code>app.use(multer({ 
          dest: './uploads/',
          rename: function (fieldname, filename) {
              return filename.replace(/\W+/g, '-').toLowerCase() + Date.now();
          },
          putSingleFilesInArray: true       
          })
  );
  </code></pre>
  
  <p>upload.js:</p>
  
  <pre><code>router.route('/')
      .get(function(req, res){
          res.render('uploads');
      })
      .post(function(req, res){
          //how to wait here for the file to upload?
      });
  </code></pre>
  
  <p>While I am aware of onParseEnd, but I don't know how to implement it, so that I have at least some kind of information about the upload process being finished.</p>