zoukankan      html  css  js  c++  java
  • 前端下载接收后端传的文件流



    $.ajax({
            url: "/test4",
            async:true,
            contentType:'application/x-www-form-urlencoded',
            data:{},
            xhr:function(){
                var xhr = new XMLHttpRequest();
                xhr.responseType = 'arraybuffer';
                return xhr;
            },
            type:'POST',
            timeout:60000,
            success: function (result) {
                var blob = new Blob([result],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;chatset=utf-8"})
                Temp = document.createElement("a");
                Temp.href = window.URL.createObjectURL(blob);
                Temp.download = new Date().getTime()+'excel';
                $('body').append(Temp)
                Temp.click();
            }
        });
  • 相关阅读:
    Java遍历Map、List、Array
    自签名SSL生成
    oracle_round
    Timestamp_时间戳
    oracle_substr
    eval
    orcale_聚合函数
    oracle_decode
    js_JSON
    sql拼接
  • 原文地址:https://www.cnblogs.com/Crush123/p/14143850.html
Copyright © 2011-2022 走看看