在本地录音,回调到tempFilePath路径,在上传给后台 uni.uploadFile filePath: tempFilePath,但是后台说传过去的是空值
- 发布:2019-12-13 15:54
- 更新:2020-11-19 10:53
- 阅读:2931
uniapp上传录音文件
1***@qq.com - 90后IT男
录音文件上传时,在临时路径前边添加:file://
亲测,已解决
-
回复 王德印: openCamera() {
let that = this
that.imgList = []
uni.chooseImage({
sourceType: ['album', 'camera'],
count: 1,
sizeType: ['compressed'],
success: e => {
that.imgList = [...that.imgList, ...e.tempFiles]
this.updateHeaderImage()
}
});
},2021-05-06 10:16
-
updateHeaderImage() {
let that = this
let url = 'upload/file'
uni.uploadFile({
url: baseUrlApi + 'upload/file',
filePath: that.imgList[0].path,
name: 'file',
header: {
"Authorization": user.token,
"Platform": "XCX"
},
success: res => {2021-05-06 10:16
9***@qq.com (作者)
没有
2020-06-17 17:01