title: Upload File in Node.js via Multer
body: <p>I have a Node.js web app. In the app I'm using Express. I need to let a user upload a picture. To do that, I've reviewed some examples online, but none seem to meet my needs. Specifically, I want to get the file that was uploaded, save it to the local disk, and do some manipulation on it. Right now, I have the following:</p>
  
  <pre><code>const app = this;
  const multer  = require('multer')
  const upload = multer({ dest: 'uploads/' })
  
  app.post('/picture/upload', upload.single('myPicture'), function(req, res) {
    console.log('uploaded');
    var picture = req.file;
    console.log(picture);
    res.send({ id: 1, fileName: 'info', originalName: 'name' });
  });
  </code></pre>
  
  <p>When I upload a file from my web page, I see the following in the console window:</p>
  
  <pre><code>uploaded
  undefined
  </code></pre>
  
  <p>When I look in Fiddler, I can see that the image is being passed to the server. It's just like I'm not "accessing" it properly. How do I get an uploaded file on the server side in Node?</p>
  
  <p>UPDATE:
  As requested by responder:</p>
  
  <p><strong>req.headers:</strong></p>
  
  <pre><code>{ host: 'localhost:1337',
    connection: 'keep-alive',
    'content-length': '395665',
    accept: 'application/json, text/plain, */*',
    origin: 'http://localhost:1337',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
    'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary[someRandomCharacters]',
    referer: 'http://localhost:1337/picture',
    'accept-encoding': 'gzip, deflate, sdch, br',
    'accept-language': 'en-US,en;q=0.8',
    cookie: '' 
  }
  </code></pre>
  
  <p><strong>req.body:</strong></p>
  
  <pre><code>{ myPicture: 'data:image/png;base64,[LONG STRING OF ALPHANUMERIC CHARACTERS]' }
  </code></pre>
  
  <p>Thank you!</p>