let url = this.$store.state.imgurl
url= url + `File/xcx/uploadingShareUrlFile?userId=${this.USERID}&type=0&proId=${this.productDetail.id}`
wx.uploadFile({
url:url, // Replace with your API endpoint
filePath: filePath,
name: 'multipartFile', // Name of the field that your server expects
success(res) {
console.log('Upload successful:', res.data);
// Handle your success logic here
},
fail(err) {
console.error('Error uploading file:', err);
// Handle your error logic here
}
});
formdata上传文件给后端
最新推荐文章于 2024-08-30 10:14:48 发布