uniCloud.chooseAndUploadFile({
type: 'video',
extension: ['avi'],
onChooseFile(res) {
console.log('选择图片的回调',res);
uni.showLoading({
title: '正在上传...',
mask: true
})
const processAll = []
for (let i = 0; i < res.tempFiles.length; i++) {
processAll.push(cropImg(res.tempFiles[i]))
}
return Promise.all(processAll).then((fileList) => {
let result = {
tempFilePaths: []
}
result.tempFiles = fileList.map((fileItem, index) => {
result.tempFilePaths.push(fileItem.path)
return {
path: fileItem.path,
cloudPath: '' + Date.now() + index + '.' + fileItem
.ext, // 云端路径,这里随便生成了一个
fileType: fileItem.fileType
}
})
return result
})
}
}).then(res => {
console.log('视频上传成功回调', res);
})
1***@qq.com
- 发布:2024-06-07 14:35
- 更新:2024-06-07 14:35
- 阅读:163
uniCloud.chooseAndUploadFile上传视频extension设置['avi']不生效?期望:设置后不能选择mp4文件才对
分类:uniCloud
0 个回复