当前位置:网站首页>Download files and preview pictures
Download files and preview pictures
2022-07-02 13:16:00 【1900's 88 keys】
Download files
a The label specifies download Property will download the link to jump , The premise is homology
<h2> Front-end blob object --- Download files && Preview of the picture </h2>
<br>
<a id="btn"> Download the file </a>
<script> var str = ` <div> <p> Download files </> </div> `; var blob = new Blob([str], {
type: 'text/html' }); btn.onclick = function (e) {
this.setAttribute('download', '123.html'); this.href = URL.createObjectURL(blob); } </script>
Preview of the picture
<input type="file" id="input1">
<input type="file" id="input2">
<script> // Sync input1.onchange = function (e) {
var file = e.target.files[0]; var img = new Image(); img.src = URL.createObjectURL(file) document.body.appendChild(img) } // asynchronous input2.onchange = function (e) {
var file = e.target.files[0]; var img = new Image(); var fileRead = new FileReader(); document.body.appendChild(img) fileRead.onload = function () {
img.src = fileRead.result } fileRead.readAsDataURL(file) } </script>
边栏推荐
- JS逆向之行行查data解密
- 完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。
- Unforgettable Ali, 4 skills, 5 hr additional written tests, it's really difficult and sad to walk
- Japan bet on national luck: Web3.0, anyway, is not the first time to fail!
- Rust language document Lite (Part 1) - cargo, output, basic syntax, data type, ownership, structure, enumeration and pattern matching
- 【笔耕不辍勋章活动】生命不止,写作不息
- 阿里发布的Redis开发文档,涵盖了所有的redis操作
- Jerry's watch delete alarm clock [chapter]
- JS reverse massive creative signature
- 二、帧模式 MPLS 操作
猜你喜欢
(7) Web security | penetration testing | how does network security determine whether CND exists, and how to bypass CND to find the real IP
[opencv learning] [moving object detection]
leetcode621. 任务调度器
js2day(又是i++和++i,if语句,三元运算符,switch、while语句,for循环语句)
Unity SKFramework框架(十六)、Package Manager 开发工具包管理器
Unity skframework framework (XVI), package manager development kit Manager
【蓝桥杯选拔赛真题43】Scratch航天飞行 少儿编程scratch蓝桥杯选拔赛真题讲解
Js2day (also i++ and ++i, if statements, ternary operators, switch, while statements, for loop statements)
EasyDSS点播服务分享时间出错如何修改?
Jerry's watch time synchronization [chapter]
随机推荐
Jerry's watch reads the alarm clock [chapter]
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
【OpenGL】笔记二十九、高级光照(镜面高光)
Day4 operator, self increasing, self decreasing, logical operator, bit operation, binary conversion decimal, ternary operator, package mechanism, document comment
3 a VTT terminal regulator ncp51200mntxg data
腾讯三面:进程写文件过程中,进程崩溃了,文件数据会丢吗?
Unity SKFramework框架(十四)、Extension 扩展函数
[200 opencv routines] 100 Adaptive local noise reduction filter
Unity skframework Framework (XVI), package manager Development Kit Manager
Unity skframework framework (XXI), texture filter map resource filtering tool
js2day(又是i++和++i,if语句,三元运算符,switch、while语句,for循环语句)
Unity skframework framework (XV), singleton singleton
OpenApi-Generator:简化RESTful API开发流程
Answer: can the audio be set to on by default during easydss video on demand?
[opencv learning] [Canny edge detection]
Unity SKFramework框架(十六)、Package Manager 開發工具包管理器
TVOC, VOC, VOCs gas detection + Solution
日本赌国运:Web3.0 ,反正也不是第一次失败了!
互联网常见34个术语解释
Mysql常用命令详细大全