当前位置:网站首页>Upload pictures Base64
Upload pictures Base64
2022-07-24 07:03:00 【MMNHD】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="file">
<img src="" alt="">
<script>
document.querySelector('input').addEventListener('change', function () {
let file = document.querySelector('input').files[0]
console.log(file);
let base64 = new FileReader()
base64.readAsDataURL(file)
base64.onload = function () {
let a = this.result
console.log(a);
document.querySelector('img').src = a
}
})
</script>
</body>
</html>
边栏推荐
- Tensorflow Einstein function
- 华为专家自述:如何成为优秀的工程师
- xavier_ normal_ Initialization test
- Redis distributed cache learning notes
- Wix path with spaces
- Ue4/5 cannot open the file "xxx.generated.h" (cannot open file xxx.generated.h) solution summary
- Redis basic type - ordered set Zset
- Redis基本类型-有序集合Zset
- Who you are is up to you!
- Nodejs enables multi process and inter process communication
猜你喜欢
![[lvgl] API functions for setting, changing and deleting styles of components](/img/55/f25a510cf04caff7ee15e72360c3a1.png)
[lvgl] API functions for setting, changing and deleting styles of components

"Big factory interview" JVM Chapter 21 questions and answers

Geek planet ByteDance one stop data governance solution and platform architecture

MySQL gets the self incrementing line mark (different from MySQL version)

上传excel文件

MapReduce (I)

【C语言】操作符详解(深入理解+整理归类)

不运动也能增肌???打一针冬眠黑熊的血清就行

Metaltc5.0 realizes webrtc version IPC of Junzheng pure C
![[media controller] open source project learning notes (based on Arduino micro development board)](/img/08/39ed97437f235806c6d4415f53c47b.png)
[media controller] open source project learning notes (based on Arduino micro development board)
随机推荐
Sealos 打包部署 KubeSphere 容器平台
tensorflow scatter_ Nd function
Redis 哨兵机制
Geek planet ByteDance one stop data governance solution and platform architecture
Redis data type - list list
[media controller] open source project learning notes (based on Arduino micro development board)
Metaltc5.0 realizes webrtc version IPC of Junzheng pure C
Three level classification / menu query tree structure
Libevent and multithreading
Create WPF project
Redis基本类型-结合Set
STM32 external interrupt (register version)
[learning notes] see the difference between a+++a and a+a++ from the compilation
Libc.so.6/glibc cross compilation
一个AI玩41个游戏,谷歌最新多游戏决策Transformer综合表现分是DQN的两倍
Prediction of advertising investment and sales based on regression analysis -- K neighborhood, decision tree, random forest, linear regression, ridge regression
(笔记整理未完成)【图论:求单源最短路径】
Libevent multithreaded server + client source code
STM32基于hal库的adc以DMA的多通道采样以及所遇问题解决
Record the pits encountered in the deserialization of phpserializer tool class