当前位置:网站首页>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>
边栏推荐
- How to modify the error of easydss on demand service sharing time?
- [opencv learning] [contour detection]
- Unity SKFramework框架(十五)、Singleton 单例
- Jerry's watch modifies the alarm clock [chapter]
- Jerry's watch ringtone audition [article]
- Traverse entrylist method correctly
- js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)
- Js1day (input / output syntax, data type, data type conversion, VaR and let differences)
- 文件的下载与图片的预览
- Get started REPORT | today, talk about the microservice architecture currently used by Tencent
猜你喜欢

Ltc3307ahv meets EMI standard, step-down converter qca7005-al33 phy

Unity skframework framework (XVIII), roamcameracontroller roaming perspective camera control script

屠榜多目标跟踪!BoT-SORT:稳健的关联多行人跟踪

嵌入式软件开发

OpenApi-Generator:简化RESTful API开发流程

【蓝桥杯选拔赛真题43】Scratch航天飞行 少儿编程scratch蓝桥杯选拔赛真题讲解

三翼鸟两周年:羽翼渐丰,腾飞指日可待

Js1day (input / output syntax, data type, data type conversion, VaR and let differences)

Professor of Shanghai Jiaotong University: he Yuanjun - bounding box (containment / bounding box)

Everyone wants to eat a broken buffet. It's almost cold
随机推荐
Jerry's weather direction coding table [chapter]
Unity skframework framework (XV), singleton singleton
[opencv] [image gradient]
日本赌国运:Web3.0 ,反正也不是第一次失败了!
What are eNB, EPC and PGW?
JS iterator generator asynchronous code processing promise+ generator - > await/async
[OpenGL] notes 29. Advanced lighting (specular highlights)
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
Jerry's watch delete alarm clock [chapter]
腾讯三面:进程写文件过程中,进程崩溃了,文件数据会丢吗?
阿里发布的Redis开发文档,涵盖了所有的redis操作
JS逆向之巨量创意signature签名
Ali on three sides, it's really difficult to successfully get the offer rated P7
(6) Web security | penetration test | network security encryption and decryption ciphertext related features, with super encryption and decryption software
[opencv learning] [Canny edge detection]
Jerry's weather code table [chapter]
EasyDSS点播服务分享时间出错如何修改?
Jerry's watch gets the default ringtone selection list [article]
Should I have a separate interface assembly- Should I have a separate assembly for interfaces?
Fundamentals of face recognition (facenet)