title: Upload image to nodejs server using retrofit android, file undefined
body: <p>I am using Nodejs server and Android for image uploading.</p>
  <p>Node js code</p>
  <pre><code>const storage = multer.diskStorage({
      destination: (req, file, cb) =&gt; {
          cb(null, '../uploads');
      },
      filename: (req, file, cb) =&gt; {
          console.log('file ',file);
          cb(null, (Date.now() + path.extname(file.originalname)));
      }
  });
  
  const fileFilter = (req, file, cb) =&gt; {
      if (file.mimetype == 'image/jpeg' || file.mimetype == 'image/png') {
          cb(null, true);
      } else {
          cb(null, false);
      }
  }
  
  const upload = multer({ storage: storage, fileFilter: fileFilter });
  
  app.post('/upload', upload.single('file'), (req, res, next) =&gt; {
    const file = req.file // return undefined
    if (!file) {
      const error = new Error('Please upload a file')
      error.httpStatusCode = 400
      return next(error)
    }
    res.send(file)
  })
  </code></pre>
  <p>Android code</p>
  <pre><code>File file = new File(compressedImagePath);
  MultipartBody.Part filePart = MultipartBody.Part.createFormData(&quot;file&quot;, file.getName(), RequestBody.create(MediaType.parse(&quot;image/*&quot;), file));
  Call&lt;ImageUploadResponse&gt; call = service.uploadImage(filePart);
  </code></pre>
  <p>This returns in undefined in the server in the following code line.</p>
  <pre><code>const file = req.file
  </code></pre>
  <p>Is there any issue on both sides? This works perfectly in the postman.</p>