I'm having issues with uploading files. I have the following code:
App.js
var bodyParser = require('body-parser');
var busboy = require('connect-busboy');
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
app.use(busboy({immediate: true, limits: {fileSize: 25 * 1024 * 1024}}));
Attachments.js
router.post('/:table/:id', function (req, res) {
req.busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
//Do stuff..
});
});
The 'file' event is not firing. I tried logging, it does get into the route, so I don't think it's a routing issue. Any thoughts, what am I doing wrong?
Running versions:
- Express : v4.x
- Body-Parser : v1.11.0
- connect-busboy : v0.0.2