wx.chooseMessageFile type设为file,依然只能选择图片?

小程序 文章 2022-02-28 18:00 2178 0 全屏看文

AI助手支持GPT4.0

wx.chooseMessageFile type设为file,依然只能选择图片?wx.chooseMessageFile type is set to file, still only pictures can be selected?

wx.chooseMessageFile type设为file,依然只能选择图片?

wx.chooseMessageFile({

count: 1, //能选择文件的数量

type: 'file',

extension: ['pdf'],

success(res) {

// tempFilePath可以作为img标签的src属性显示图片

const tempFilePaths = res.tempFiles

}

})

wx. Choosemessagefile ({count: 1, / / number of files that can be selected type: 'file', extension: ['pdf '], success (RES) {/ / tempfilepath can be used as SRC attribute of img tag to display picture const tempfilepaths = res.tempfiles}})

回答:

社区技术运营专员-horanzhou:

 type设为file可以选择除了图片和视频之外的其它的文件

社区技术运营专员-horanzhou:用你提供的代码的,你可以弄代码片段我复现一下吗https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
圣殿骑士:

我猜,你是ios 手机!

若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人

云D旋律:

请直接跑下面的代码,看看是哪里的问题。

https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseMessageFile.html


wx.chooseMessageFile({  count: 10,  type: 'file',  success (res) {    // tempFilePath可以作为img标签的src属性显示图片    const tempFilePaths = res.tempFiles  }})

-EOF-

AI助手支持GPT4.0