uni-app 上传文件APP报错 API `chooseFile` is not yet implemented

uni-app 上传文件APP报错 API chooseFile is not yet implemented

开发环境 版本号 项目创建方式
Windows win10 HBuilderX

产品分类:uniapp/App

PC开发环境操作系统:Windows

HBuilderX类型:正式

HBuilderX版本号:3.1.18

手机系统:Android

手机系统版本号:Android 11

手机厂商:华为

手机机型:mate9

页面类型:vue

打包方式:云端

示例代码:

上传文件APP报错 API `chooseFile` is not yet implemented 

操作步骤:

上传文件APP报错 API `chooseFile` is not yet implemented 

预期结果:

上传文件APP报错 API `chooseFile` is not yet implemented 

实际结果:

上传文件APP报错 API `chooseFile` is not yet implemented 

bug描述:

上传文件APP报错 API `chooseFile` is not yet implemented 

更多关于uni-app 上传文件APP报错 API `chooseFile` is not yet implemented的实战教程也可以访问 https://www.itying.com/category-93-b0.html

15 回复

不知道好久app才能选择除了视频和图片之外的文件哦…这个需求真的很大…

更多关于uni-app 上传文件APP报错 API `chooseFile` is not yet implemented的实战教程也可以访问 https://www.itying.com/category-93-b0.html


这个api暂时只有h5支持

请详细说明您的问题,提供复现示例,【bug优先处理规则】https://ask.dcloud.net.cn/article/38139

同样的问题 API chooseFile is not yet implemented,就调用这个api,没其他操作,HBuilder基座。

H5端正常,app端不行

upload() { let that = this; uni.chooseFile({ // extension: [’.zip’, ‘.doc’], count: 8, success: (res) => { //that.annexList = that.annexList.concat(res.tempFilePaths); for (let i = 0; i < res.tempFilePaths.length; i++) { let name = res.tempFiles[i].name; uni.uploadFile({ url: …, filePath: res.tempFilePaths[i], name: ‘file’, header: { ‘Authorization’:…, }, formData: {
},
success: (res) => {

                        }  
                    });  
                }  
            }  
        })  
    },<br>

这个问题我也遇到了,官网还没解决吗?

一样的错误. 上传个文件 非图片,视频 居然不行!! ??

上传文件很麻烦,安卓高手还能找到,ios是封闭系统。我的处理方式是h5上传文件,app传视频或图片。也可以在app上点击上传时,打开一个webview,上传文件后返回文件地址,不过我没搞出来。

示例是可以成功上传的

安卓端

示例app?api的平台差异写了不支持挨批评、

安卓手机和h5都上传成功了,实测

请问有没有什么解决的办法啊

这个错误是因为在App端使用了错误的API名称。uni-app的API命名规范是驼峰式,正确的API名称应该是 chooseFile 而不是 chooseFile

请检查代码中是否错误地写成了 chooseFile,正确的调用方式应该是:

uni.chooseFile({
  count: 1,
  success: (res) => {
    console.log(res.tempFiles)
  }
})
回到顶部