# wx.miniapp.chooseFile
iOS >= 1.2.8Android >= 1.1.10
Pull the System Files selection box to select the file
Note: this interface does not support debugging in WeChat developer tools, does not support debugging in mobile application assistant, need to build the installation package installed on the phone for testing
# parameter
attribute | type | Default value | Required | Introductions |
---|---|---|---|---|
allowsMultipleSelection | boolean | false | no | Is it allowed to select multiple files |
# Return parameter
attribute | type | Introductions |
---|---|---|
tempFiles | Array | List of selected files |
tempFiles [].path | string | A temporary path to a local file, as in wxfile://tmp_xxxxx.jpg |
tempFiles [].name | string | Local File Name |
tempFiles [].size | number | Local Temporary File Size, Unit B |
# JSAPI Examples of code
wx.miniapp.chooseFile({
success(res) {
const tempFiles = res.tempFiles
console.log('wx.miniapp.chooseFile success', tempFiles )
},
fail(err) {
console.log('wx.miniapp.chooseFile fail', err)
}
})