当前位置:网站首页>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
}
})
}
})
边栏推荐
- How to find out if the U disk file of the computer reinstallation system is hidden
- After 3 years of testing bytecan software, I was ruthlessly dismissed in February, trying to wake up my brother who was paddling
- The programmer said, "I'm 36 years old, and I don't want to be rolled, let alone cut."
- Basic chart interpretation of "Oriental selection" hot out of circle data
- 快讯 l Huobi Ventures与Genesis公链深入接洽中
- Who said that new consumer brands collapsed? Someone behind me won
- What should I do if the USB flash disk data is formatted and how can I recover the formatted USB flash disk data?
- MySQL master-slave multi-source replication (3 master and 1 slave) setup and synchronization test
- Supersocket 1.6 creates a simple socket server with message length in the header
- How to answer the dualistic opposition of Zhihu
猜你喜欢
The intranet penetrates the zerotier extranet (mobile phone, computer, etc.) to access intranet devices (raspberry pie, NAS, computer, etc.)
DAY TWO
Entropy information entropy cross entropy
英国都在试行4天工作制了,为什么BAT还对996上瘾?
Wind chime card issuing network source code latest version - commercially available
快讯 l Huobi Ventures与Genesis公链深入接洽中
GPIO简介
Penetration test --- database security: detailed explanation of SQL injection into database principle
【无人机】多无人协同任务分配程序平台含Matlab代码
Server SMP, NUMA, MPP system learning notes.
随机推荐
Oracle对表进行的常用修改命令
Gradle knowledge generalization
Who said that new consumer brands collapsed? Someone behind me won
Use source code compilation to install postgresql13.3 database
【CVPR 2022】半监督目标检测:Dense Learning based Semi-Supervised Object Detection
openresty ngx_lua子请求
Use Yum or up2date to install the postgresql13.3 database
在Docker中分分钟拥有Oracle EMCC 13.5环境
How about the order management of okcc call center
Server SMP, NUMA, MPP system learning notes.
量子时代计算机怎么保证数据安全?美国公布四项备选加密算法
【无人机】多无人协同任务分配程序平台含Matlab代码
Unity 颜色板|调色板|无级变色功能
leetcode:236. The nearest common ancestor of binary tree
MATLIB reads data from excel table and draws function image
Experiment 6: installing eve-ng
Pinia module division
SuperSocket 1.6 创建一个简易的报文长度在头部的Socket服务器
Tourism Management System Based on jsp+servlet+mysql framework [source code + database + report]
Scholar doctor hahaha