码迷,mamicode.com
首页 > Web开发 > 详细

angular 文件上传

时间:2018-06-06 12:28:19      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:file上传

文件上传时的处理

$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 文件上传

标签:file上传

原文地址:http://blog.51cto.com/dd118/2125414

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!