post input type file to server node.js from angular service call

I have simple multipart formdata

<form action="/upload" enctype="multipart/form-data" method="post">
      <span class="btn btn-file">
        <input type="file" name="file" ng-model="file"/>
        <span class="btn btn-primary" ng-click="upload()">Upload</span>
      </span>
</form>

What I want to do it, post all the information related to file to the server written in node.js

server.js This is file upload handler written in node. Formidable expects all parameters of a file.

upload: function uploadfn (req, res) {

    var form = new formidable.IncomingForm();
    form.parse(req, function(err, fields, files) {
        // `file` is the name of the <input> field of type `file`
        var old_path = files.file.path,
        file_size = files.file.size,
        file_ext = files.file.name.split('.').pop(),
        index = old_path.lastIndexOf('/') + 1,
        file_name = old_path.substr(index),
        new_path = path.join(process.env.PWD, '/uploads/', file_name + '.' + file_ext);
        fs.readFile(old_path, function(err, data) {
            fs.writeFile(new_path, data, function(err) {
                fs.unlink(old_path, function(err) {
                    if (err) {
                        res.status(500);
                        res.json({'success': false});
                    } else {
                        res.status(200);
                        res.json({'success': true});
                    }
                });
            });
        });
    });
}

The things I'm stuck at is, I have service call ready in angular as follows:

service.factory('FileUpload', function ($resource) {
    return $resource('/upload', {}, {
        post: {method: 'POST'}
    });
});

This call hits the backend from angular controller as follows

$scope.upload = function(){
    console.log($scope.file);
    FileUpload.post(function(){
    });
}

I'm not sure how to post the file submit so that node can catch it. Also $scope.file is undefined.

Please help me solve this.

There's a good directive for file upload for angularjs, try to use it https://github.com/danialfarid/angular-file-upload