9***@qq.com
9***@qq.com
  • 发布:2019-12-13 15:54
  • 更新:2020-11-19 10:53
  • 阅读:2736

uniapp上传录音文件

分类:uni-app

在本地录音,回调到tempFilePath路径,在上传给后台 uni.uploadFile filePath: tempFilePath,但是后台说传过去的是空值

2019-12-13 15:54 负责人:无 分享
已邀请:
liru07441019

liru07441019

请问您问题解决了吗?我也遇到了这个问题

1***@qq.com

1***@qq.com - 小白

你好,请问这个问题解决了吗

cycle1321

cycle1321

我也遇到这个问题了,测试基座,没问题,自定义基座,后端报没有传name:fiel,打正式包又说没带文件

1***@qq.com

1***@qq.com - 90后IT男

录音文件上传时,在临时路径前边添加:file://

亲测,已解决

  • 唯灬恋

    加了 file:// 还是 {"errMsg":"uploadFile:fail undefined"}

    2021-03-24 14:24

  • 王德印

    回复 唯灬恋: 我跟你一样path is not defined

    2021-05-03 17:30

  • 1***@qq.com

    回复 王德印: 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

  • 1***@qq.com

    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

  • 1***@qq.com

    亲测可用

    2021-05-06 10:17

  • 2***@qq.com

    回复 王德印: 请问您问题解决了吗?我也遇到了这个问题

    2021-05-11 15:32

该问题目前已经被锁定, 无法添加新回复