跳到主要内容

bn.chooseFile

chooseFile(options): Promise<ChooseFileResponse>

description Select files from the file system.

remark supported jssdk >= 4.8.0

example

const res = await bn.chooseFile({
count: 9,
extension: ['pdf']
})
console.log(res.tempFiles)

Parameters

NameType
optionsChooseFileOptions

Returns

Promise<ChooseFileResponse>

Interface: ChooseFileOptions

NameTypeDescription
countnumberThe maximum number of images allowed range is [1,9]. Because of the native limits, users may select more files than expected, but the API will return only count files
extension?string[]Filter by filename extension. No filter by default

Interface: ChooseFileResponse

NameTypeDescription
tempFilesTempFile[]The local temporary file list for images