angular 文件上传

2023-06-13,,

文件上传时的处理

$scope.submit = function(){
    var url = $scope._datalistmodel.impexp.imp;
    var t_file = new FormData(document.getElementById('upload_file'));//id是form表单的id
    $http({
        headers : {
            'content-type':undefined
        },
        url : url,
        data : t_file,
        method : 'post',
        transformRequest:angular.identity
    }).then(function(d){
    });
};

《angular 文件上传.doc》

下载本文的Word格式文档,以方便收藏与打印。