harmony 鸿蒙File Subsystem Changelog

  • 2023-10-30
  • 浏览 (304)

File Subsystem Changelog

cl.file.1 Change of picker PhotoViewPicker.save() Compatibility

Changed the PhotoViewPicker.save() interface compatibility.

Change Impact

For applications developed based on earlier versions, PhotoViewPicker.save() saves files only to the file manager directory, and these files are invisible in Gallery. To save a file to Gallery, create a media asset using a security component. For details, see Creating a Media Asset Using a Security Component.

Key API/Component Changes

Module Method/Attribute/Enum/Constant Change Type
picker function PhotoViewPicker.save(option?: PhotoSaveOptions) : Promise<Array<string>> Interface compatibility
picker function PhotoViewPicker.save(option: PhotoSaveOptions, callback: AsyncCallback<Array<string>>) : void Interface compatibility
picker function PhotoViewPicker.save(callback: AsyncCallback<Array<string>>) : void Interface compatibility

Adaptation Guide

PhotoViewPicker.save() starts FilePicker and saves files to a directory in the system file manager. From OpenHarmony_4.0.11.2, FilePicker cannot access assets in the media library. As a result, the files in the file manager directory cannot be viewed in Gallery. To enable the images or videos to be viewed in Gallery, use <SaveButton> to save images or videos.

Example

See Creating a Media Asset Using a Security Component.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙OpenHarmony Docker镜像

harmony 鸿蒙OpenHarmony Docker Image

harmony 鸿蒙Legal Notices

harmony 鸿蒙OpenHarmony Project

harmony 鸿蒙IDL Specifications and User Guide (for System Applications Only)

harmony 鸿蒙Application Development

harmony 鸿蒙OAID Service

harmony 鸿蒙AI

0  赞