当前位置:网站首页>JS downloads files according to binary data
JS downloads files according to binary data
2022-07-16 05:50:00 【Jason show】
The logic is simple , Go straight to the code
var xhr = new XMLHttpRequest()
xhr.open('get', '${ctx!}/admin/v1/licence/' + id)
xhr.responseType = "blob" // Set the response data type to blob, If not set, the downloaded file will be larger than the source file
xhr.send()
xhr.onload = function() {
var blob = new Blob([this.response], {
type: this.responseType }); // ArrayBuffer , mime type
// console.log(this.response.length, blob.size)
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = 'license.lic';
a.click();
}

边栏推荐
- 使用crontab遇到的一点问题,报错/var/spool/cron : Permission denied和bash: /usr/bin/chattr: Permission denied
- BUUCTF 九连环
- ramda.js api 速查
- 包管理工具
- [BJDCTF2020]Cookie is so stable
- [Huang ah code] wechat applet +php realizes instant messaging chat function
- admin 系统被嵌套在第三方系统中的跨域异常
- 内网渗透笔记——msf
- [Huang ah code] PHP cooperates with wechat official account to generate promotion QR code
- php对接支付宝Web支付-tp5.1框架
猜你喜欢
![[prettier] the code automatically formatted by prettier does not take effect](/img/5a/c56f4d2d4c7a9bdef0bda5a90ec190.png)
[prettier] the code automatically formatted by prettier does not take effect

Sécurité des réseaux intervention d'urgence - technologie de collecte de données électroniques

BUUCTF 面具下的flag

Intranet penetration notes - Registry self startup and MSI rights lifting

Flag under buuctf mask

js作用域与作用域链

Buuctf webshell back door
![[BJDCTF2020]Cookie is so stable](/img/d8/fb9fc2496ee8b23ec6fd6195051030.png)
[BJDCTF2020]Cookie is so stable
![Secondary development tutorial of fastadmin [simple construction, multi table problems, API development]](/img/ea/25cb69f646e413f810d9e6d49f182c.png)
Secondary development tutorial of fastadmin [simple construction, multi table problems, API development]

window系统盘瘦身(开发)
随机推荐
Componentized coding process -- todo list case
Single file component
[Huang ah code] getting started with MySQL - 1. SQL execution process
[BJDCTF2020]Cookie is so stable
Taobao project exercise summary
内网渗透笔记——三层发现and四层发现
[NCTF2019]Fake XML cookbook
日志黑名单,真的能帮你省钱!
网络安全应急响应-基础技能
What if there is no scroll bar on the right side of the page and you can't see the content beyond it?
组件化编码流程--Todo-list案例
BUUCTF 后门查杀
Implementation principle of new keyword in JS
Intranet penetration notes - MSF
2022第十五届全国大学生信息安全竞赛(ciscn)西南赛区部分WP
Automatic deployment of server docking code cloud webhooks -- ultra detailed -- PHP
Clues in buuctf packets
Log blacklist can really save you money!
North tour project notes
网页右边没有滚动条,内容超出也看不到怎么办?