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