title: HTML + Node.js File Upload
body: <p>Please help me out resolving this. <strong>I get empty values as result</strong> .</p>
  
  <p><strong>HTML Code</strong></p>
  
  <pre><code>&lt;form method="post" enctype="multipart/form-data" action="/file-upload"&gt;
      &lt;input type="text" name="username"&gt;
      &lt;input type="password" name="password"&gt;
      &lt;input type="file" name="thumbnail"&gt;
      &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Node.js</strong></p>
  
  <pre><code>var express = require('express');
  var http = require('http');
  var request = require('request');
  var bodyParser = require('body-parser');    
  
  var app = express();
  app.use(express.static(__dirname + '/app/'));
  
  // parse urlencoded request bodies into req.body
  app.use(bodyParser.urlencoded({ extended: true }));
  
  var server = app.listen(8080,function(){
   console.log("Node.js image upload");
  });
  
  app.post('/file-upload', function(req, res, next) {
   console.log(req.body);
   console.log(req.files);
   res.writeHead(200, {'Content-Type': 'text/plain'});
   res.end('Success\n');
  });
  </code></pre>