title: Multer file upload doesn't work with swaggerExpress
body: <p>I'm trying to upload multipart form data using <strong>multer</strong>. I'm using swagger express middleware for my APIs. Without swagger everything was working. But with swagger, file is not uploaded. There's no validation error, but it simply doesn't upload file. Here's some code that you may want to see:</p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>SwaggerExpress.create(config, function(err, swaggerExpress) {
    if (err) { throw err; }
    swaggerExpress.register(app);
    var port = 8850;
      https.createServer(options, app).listen(port, function () {
          console.log('Bus993 server started @ %s!', port);
      });
  });
  </code></pre>
  
  <p><strong>upload function</strong></p>
  
  <pre><code>function uploadImage(req, res, multer){
      console.log("here", req.files);
      //ABOVE SHOWS A VALID FILE
      var storage = multer.diskStorage({
          destination: function (req, file, cb) {
              console.log("fILE", file);
              //THIS IS NOT PRINTED
              cb(null, '../../public/images');
          },
          filename: function (req, file, cb) {
              console.log(file);
              //THIS IS NOT PRINTED
              cb(null, file.originalname.replace(/[.]{1}[a-zA-Z]+$/, "") + '_' + moment().format('X') + getExtension(file));
          }
      });
  
  
      var upload = multer({storage: storage, fileFilter: fileFilter}).single('imageFile');
  
      upload(req, res, function (err) {
          if (err) {
              res.status(422).json(
                  {
                      status: "error",
                      data: {error: err.message},
                      message: "Image upload failed."
                  }
              );
          } else {
              res.status(200).json(
                  {
                      status: "success",
                      data: "",
                      message: "Image uploaded successfully."
                  }
              );
          }
      });
  
  
      function fileFilter(req, file, cb) {
          console.log("fILE", file);
          if ((file.mimetype != 'image/jpeg' &amp;&amp; file.mimetype != 'image/png' &amp;&amp;         file.mimetype != 'image/gif') || file.size &gt; 8000) {
              cb(new Error('Invalid file.'), false);
          } else {
              cb(null, true);
          }
      }
  
  
      function getExtension(file) {
          var res = '';
          if (file.mimetype === 'image/jpeg') res = '.jpg';
          if (file.mimetype === 'image/png') res = '.png';
          if (file.mimetype === 'image/gif') res = '.gif';
          return res;
      }
  }
  </code></pre>
  
  <p>So, the problem seems that <strong>file</strong> is undefined here since when I'm using swagger. Earlier it was fine. But now it returns <code>status:success</code> but image was never uploaded.</p>
  
  <p>Am I doing something wrong?</p>