Skip to content Skip to sidebar Skip to footer

Node Busboy + Express 4 + Ng-file-upload Doesn't Trigger Events

I'm using mean.io stack + ng-file-upload does anyone know why the events are not triggered ? client controller('ArticleParentCtrl', ['$scope', '$timeout', '$upload', function ($sc

Solution 1:

You're not piping your request into busboy. You need to do req.pipe(busboy);.

Solution 2:

This works for me

busboy not firing finish event

varBusboy = require('busboy');

exports.upload = function(req, res) {
    var busboy = newBusboy({
        headers: req.headers
    });

    busboy.on('error', function(err) {
        console.log(err);
    });

    busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
        console.log(fieldname);
        console.log(file);
        console.log(filename);
        console.log(encoding);
        console.log(mimetype);

        // see other question
        file.resume();

    });

    busboy.on('finish', function() {
        console.log('finish');
    });

    return req.pipe(busboy);

};

Post a Comment for "Node Busboy + Express 4 + Ng-file-upload Doesn't Trigger Events"