Hello, everyone.
I have a need now, that is, I can sign it manually in Mini Program, and then upload it to the server. I use canvas to sign on the screen, but I won"t upload it to the server
use the wx.uploadFile provided by Wechat not to send a web request at all
wx.canvasToTempFilePath({
canvasId: "myCanvas",
success: function (res) {
var path = res.tempFilePath;
console.log(path)
wx.uploadFile({
url: "http://localhost/e_contract/public/index.php/member/index/test",
filePath: path,
name: "file",
formData: {
"user": "test"
},
header: { "Content-Type": "multipart/form-data", "Cookie": "PHPSESSID=" + overall.json.token},
success: function (res) {
var data = res.data
console.log(res);
//do something
},
fail:function(res){
}
})
}
})