title: Express can't upload file, req.files is undefined
body: <p>I really apologize if I'm leaving something out and am totally stupid, but I've checked and checked over again a number of times, and the file upload functionality is just not working over here. I made a super minimal app to demonstate. Just generated a new express app with the most up-to-date version (3.4.7) and added the least i could to make a file upload work.</p>
  
  <p>Here's my app.js file</p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express');
  var http = require('http');
  var path = require('path');
  
  var app = express();
  
  // all environments
  app.set('port', process.env.PORT || 3000);
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'jade');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.json());
  app.use(express.urlencoded());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
  
  // development only
  if ('development' == app.get('env')) {
    app.use(express.errorHandler());
  }
  
  app.get('/tasks', function(req, res) {
    res.render('form');
  });
  app.post('/tasks', function(req, res) {
    console.log(req.files);
    res.send('ok');
  });
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log('Express server listening on port ' + app.get('port'));
  });
  
  exports = module.exports = app;
  </code></pre>
  
  <p>And here's my form.jade view file:</p>
  
  <pre><code>doctype html
  html
    head
      title Task Upload
    body
      form(action='/tasks', method='post', enctype='multipart/form-data')
        input(name='task', type='file')
        input(type='submit')
  </code></pre>
  
  <p>Everytime I try to upload a file, <code>req.files</code> logs out <code>undefined</code>. Can anyone save me out from this problem? </p>