We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
第448天 如何通过表单下载文件?
3+1官网
我也要出题
post方法
input
name=key, value=value
const from =document.createElement('form'); form.setAttribute('method','get'); form.setAttribute('action',url); // 下载文件的url form.submit()
需要在提交之前把form表单添加到document,否则会报Form submission canceled because the form is not connected.警示。使用的浏览器Microsoft Edge 版本 85.0.564.51
Activity
echo-LJ commentedon Jul 7, 2020
post方法
:根据需要传递的参数设置多个
input
:name=key, value=value
如果请求的接口不需要参数,建议设置一个input,否则可能会引起报错。
shuai4983958 commentedon Jul 8, 2020
const from =document.createElement('form');
form.setAttribute('method','get');
form.setAttribute('action',url); // 下载文件的url
form.submit()
montilloo commentedon Sep 23, 2020
需要在提交之前把form表单添加到document,否则会报Form submission canceled because the form is not connected.警示。使用的浏览器Microsoft Edge 版本 85.0.564.51