How to download generated Stream Files with Ajax
This article mainly introduces Ajax how to generate stream file download, the article is very detailed, has a certain reference value, interested friends must read!
The code is as follows:
//bind export button $("#btnExport").clickCheckLogin(function () { var form = $(""); form.attr('style', 'display:none'); form.attr('target', ''); form.attr('method', 'post'); form.attr('action', 'AjaxPost.aspx'); var input1 = $(''); input1.attr('type', 'hidden'); input1.attr('name', 'type'); input1.attr('value', 'Export'); var input2 = $(''); 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 parameters to background.
The above is "Ajax how to generate stream file download" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!