Tag:Stream file

  • Ajax generated stream file download (implementation code)

    Time:2021-9-11

    Copy codeThe code is as follows: //Bind Export button    $(“#btnExport”).clickCheckLogin(function () {         var form = $(“<form>”);        form.attr(‘style’, ‘display:none’);        form.attr(‘target’, ”);        form.attr(‘method’, ‘post’);        form.attr(‘action’, ‘AjaxPost.aspx’);        var input1 = $(‘<input>’);        input1.attr(‘type’, ‘hidden’);        input1.attr(‘name’, ‘type’);        input1.attr(‘value’, ‘Export’);        var input2 = $(‘<input>’);        input2.attr(‘type’, ‘hidden’);        input2.attr(‘name’, ‘fileId’);        input2.attr(‘value’, fileId);        $(‘body’).append(form);        form.append(input1);        form.append(input2);         form.submit();        form.remove();    }); Post the parameter […]