angular下载二进制Excel文件

        $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
        });

你可能感兴趣的:(web前端,Angular)