openharmony 鸿蒙 arkts-basic-components-web-FileSelectorParam

2026-08-25 浏览 (1)

Class (FileSelectorParam)

Implements the FileSelectorParam object to obtain files. For details about the sample code, see onShowFileSelector.

NOTE

  • The initial APIs of this component are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.

  • The initial APIs of this class are supported since API version 9.

  • The sample effect is subject to the actual device.

constructor9+

constructor()

Constructs a FileSelectorParam.

System capability: SystemCapability.Web.Webview.Core

getTitle9+

getTitle(): string

Obtains the title of this file selector.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
stringTitle of the file selector.

getMode9+

getMode(): FileSelectorMode

Obtains the mode of the file selector.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
FileSelectorModeMode of the file selector.

getAcceptType9+

getAcceptType(): Array<string>

Obtains the file filtering type.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
Array<string>File filtering type.

isCapture9+

isCapture(): boolean

Checks whether multimedia capabilities are invoked.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
booleanWhether multimedia capabilities are invoked.
The value true indicates that multimedia capabilities are invoked, and false indicates the opposite.

getMimeTypes18+

getMimeTypes(): Array<string>

Obtains the MIME type of a file.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
Array<string>MIME type of a file.

getSuggestedName23+

getSuggestedName(): string

Obtains the suggested file name, which corresponds to suggestedName in HTML's option.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
stringSuggested file name.

getDefaultPath23+

getDefaultPath(): string

Obtains the default path of the file selector, which corresponds to startIn in HTML's option.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
stringDefault path.
If startIn is set to the public directory downloads or pictures, convert it to download or images in HarmonyOS.

getDescriptions23+

getDescriptions(): Array<string>

Obtains the descriptions of a group of file types, which are optional descriptions of allowed file types and correspond to description in HTML's option.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
Array<string>Description array of the file types.

isAcceptAllOptionExcluded23+

isAcceptAllOptionExcluded(): boolean

Checks whether the file selector supports the option (*/*), that is, all files. This API corresponds to excludeAcceptAllOption in HTML's option.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
booleanWhether an option that does not apply any file type filter is excluded.
The value true indicates that an option that does not apply any file type filter is exclueded, and false indicates the opposite.

getAcceptableFileTypes23+

getAcceptableFileTypes(): Array<Array<AcceptableFileType>>

Obtains the file types, which correspond to types in HTML's option.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
Array<Array<AcceptableFileType>>File types.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-webview-WebviewController

openharmony 鸿蒙 arkts-apis-webview-t

openharmony 鸿蒙 arkts-apis-webview

openharmony 鸿蒙 capi-arkweb-type-h

openharmony 鸿蒙 arkts-basic-components-web-FullScreenExitHandler

openharmony 鸿蒙 arkts-apis-webview-WebDownloadManager

openharmony 鸿蒙 arkts-basic-components-web-VerifyPinHandler

openharmony 鸿蒙 capi-web-arkweb-webmessage8h

openharmony 鸿蒙 arkts-apis-webview-NativeMediaPlayerHandler

openharmony 鸿蒙 capi-web-arkweb-proxymethodwithresult

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/aZXTaZIK