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.
Here's my app.js file
/** * 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; And here's my form.jade view file:
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') Everytime I try to upload a file, req.files logs out undefined. Can anyone save me out from this problem?