Get the App
SLTechnology News&Howtos  ›  Development  › 

How to download generated Stream Files with Ajax

Shulou Source: shulou.com Published: 2022-06-03 08:39:22 11月15日 Update

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!

Tags: Files file downloads generation content articles code values interests parameters background guys partners buttons more knowledge industry information channels channels references Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Information OPPO Reno vpn NVidia