当前位置:网站首页>Wechat applet 7 cloud storage
Wechat applet 7 cloud storage
2022-07-19 15:11:00 【k55】
Wechat applet 1- The basics of applets , Installation and use of development tools
Wechat applet 2-WXSS,WXS
Wechat applet 3- Applet lifecycle and components
Wechat applet 4- Applet api
Wechat applet 5- Real machine test
Wechat applet 6- Development of cloud - Cloud database
1. Cloud storage
Cloud development provides a piece of storage space , Provides upload files to the cloud 、 Cloud download capability with permission management , Developers can pass through... On the applet side and cloud function side API Using cloud storage .
1). To upload pictures
// Let the user select an image
wx.chooseImage({
success: chooseResult => {
// Upload images to cloud storage space
wx.cloud.uploadFile({
// Specify the cloud path to upload to
cloudPath: 'my-photo.png',
// Specifies the temporary file path of the applet for the file to be uploaded
filePath: chooseResult.tempFilePaths[0],
// Successful callback
success: res => {
console.log(' Upload successful ', res)
},
})
},
})



2). Download the pictures
wx.cloud.downloadFile({
// file ID
fileID: 'cloud://cloud1-2gdjrvddfc6ce99e.636c-cloud1-2gdjrvddfc6ce99e-1312827414/my-photo.png',
success: res => {
// Return to temporary file path
console.log(res.tempFilePath)
},
fail: console.error
})


3). Delete file
wx.cloud.deleteFile({
// Filled in file ID
fileList: ['cloud://cloud1-2gdjrvddfc6ce99e.636c-cloud1-2gdjrvddfc6ce99e-1312827414/my-photo.png'],
success: res => {
// handle success
console.log(res.fileList)
},
fail: console.error
})

边栏推荐
- State machine exercise
- PCIe Cameralink signal generator (Cameralink image analog source)
- 天勤第九章课后习题代码
- PKI: TLS handshake
- [Axi] interpret the additional signals of the Axi protocol (QoS signal, region signal, and user signal)
- ObjectARX -- implementation of custom circle
- 5-21 拦截器 Interceptor
- 3438. 数制转换
- Cilium & Hubble
- Icml2022 | geometric multimodal comparative representation learning
猜你喜欢

Characteristics of DMA mode

Li Hongyi machine learning 2022.07.15 -- error

微信小程序9-发布代码

SBOM(Software Bill of Materials,软件物料清单)

Integrated video processing card based on Fudan micro FPGA + Huawei hisilic hi3531dv200 + Mji innovative MCU

长安链学习研究-存储分析wal机制

CSRF protection mechanism

Google Earth engine - Classification and processing of UAV images

3U VPX cooling conduction high performance srio/ Ethernet data exchange board

ICML2022 | 几何多模态对比表示学习
随机推荐
Li Hongyi machine learning introduction -2022.07.11
PKI: TLS handshake
跨域与CORS
Google Earth Engine——无人机影像进行分类处理
MySQL installation
UCAS. Deep learning Final examination questions and brief thinking analysis
Icml2022 | geometric multimodal comparative representation learning
ORA-08103
Unix ls
Notes on random nodes of force buckle 382 linked list
08_服务熔断Hystrix
Leetcode 1296. Divide the array into a set of consecutive numbers (solved)
Natural language processing model of bigscience open source bloom
High performance pxie data preprocessing board based on kinex ultrascale series FPGA (ku060 +fmc sub card interface)
GYM103660E.Disjoint Path On Tree 树上计数
2022 P gas cylinder filling examination practice questions simulated examination platform operation
新基民在支付宝上买基金安全吗
实习是步入社会的一道坎
07_服务注册与发现总结
Force deduction 912 sorting array notes