将上传的文件从Angularjs提取到Expressjs

时间:2014-05-14 12:50:51

标签: node.js angularjs express

我使用以下方法将文件上传到angularjs,但是如何从快速js中提取它?

    var formData = new FormData();

    formData.append('file', file);

    $http.post('/api/teams/upload', formData, {
        withCredentials: true,
        headers: {'Content-Type': undefined },
        transformRequest: angular.identity
    }).success(function(){
        console.log('upload success');
    }).error(function(){
        console.log('upload failed');
    });

0 个答案:

没有答案