当前位置:网站首页>Wechat applet UploadFile server, wechat applet wx Uploadfile[easy to understand]
Wechat applet UploadFile server, wechat applet wx Uploadfile[easy to understand]
2022-07-06 23:57:00 【Java architects must see】
wx.uploadFile(Object object)
Upload local resources to the server . The client initiates a HTTPS POST request , among content-type by multipart/form-data
url: Developer server address
filePath: Path to upload file resource
name: File corresponding key, Developers can use this on the server side key Get the binary content of the file
header:HTTP request Header,Header Cannot set Referer
formData:HTTP Other extras in the request form data
success: Interface calls the successful callback function
fail: Interface call failed callback function
complete: The callback function at the end of the interface call ( Successful call 、 Failure will be carried out )
example
wx.chooseImage({
success (res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://example.weixin.qq.com/upload',
filePath: tempFilePaths[0],
name: 'file',
formData: {
'user': 'test'
},
success (res){
const data = res.data
//do something
}
})
}
})
边栏推荐
- web渗透测试是什么_渗透实战
- The largest single investment in the history of Dachen was IPO today
- Résumé des connaissances de gradle
- DAY THREE
- Newsletter L Huobi ventures is in-depth contact with genesis public chain
- Oracle EMCC 13.5 environment in docker every minute
- TypeScript增量编译
- [OFDM communication] OFDM system signal detection based on deep learning with matlab code
- 【系统分析师之路】第七章 复盘系统设计(面向服务开发方法)
- matplotlib画柱状图并添加数值到图中
猜你喜欢
随机推荐
app通用功能測試用例
内网穿透zerotier 外网(手机、电脑等)访问内网设备(树莓派、NAS、电脑等)
Experiment 5: common automation libraries
谷歌百度雅虎都是中国公司开发的通用搜索引擎_百度搜索引擎url
Competition between public and private chains in data privacy and throughput
A way of writing SQL, update when matching, or insert
达晨史上最大单笔投资,今天IPO了
TypeScript增量编译
PostgreSQL使用Pgpool-II实现读写分离+负载均衡
Oracle中使用包FY_Recover_Data.pck来恢复truncate误操作的表
【自动化测试框架】关于unittest你需要知道的事
The largest single investment in the history of Dachen was IPO today
DAY FIVE
STM32 enters and wakes up the stop mode through the serial port
Newsletter L Huobi ventures is in-depth contact with genesis public chain
The "white paper on the panorama of the digital economy" has been released with great emphasis on the digitalization of insurance
Introduction au GPIO
vector的使用方法_vector指针如何使用
[CVPR 2022] semi supervised object detection: dense learning based semi supervised object detection
web渗透测试是什么_渗透实战