angular下载二进制Excel文件

来源:互联网 发布:产品设计犀牛软件 编辑:程序博客网 时间:2024/04/29 14:54
        $http({            url:'',            method: "POST",            data: '', //this is your json data string            responseType: 'arraybuffer'        }).success(function (data, status, headers, config) {            var blob = new Blob([data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});            var objectUrl = URL.createObjectURL(blob);            window.open(objectUrl);        }).error(function (data, status, headers, config) {            //upload failed        });

0 0