使用uni的方法选择了图片后
uni.chooseImage({
count: 30,
sourceType: ['camera'],
success: res => {
if (res.errMsg == 'chooseImage:ok') {
// #ifdef APP-PLUS
res.tempFilePaths.map(item => {
uni.saveFile({
tempFilePath: item,
success: res => {
var savedFilePath = res.savedFilePath;
this.imgList.push(savedFilePath);
if (this.imgList.length > 30) {
this.imgList = this.imgList.slice(0, 30);
}
}
});
});
// #endif
}
}
});
进行上传
uploadTask.onProgressUpdate(res => {
//this.process = res.progress;
this.circular[this.tag].process = res.progress;
this.circular[this.tag].total = res.totalBytesExpectedToSend;
this.circular[this.tag].single = res.totalBytesSent;
});
获取的图片大小是0KB 无法上传
如果是ios17以下就可以
DCloud_iOS_XHY
升级到最新版本测试一下吧
2024-11-14 11:51