From f3e3450645868a98115f69afeae636688edf3fa3 Mon Sep 17 00:00:00 2001 From: WangLin305 Date: Thu, 12 Jun 2025 16:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=84=E8=8C=83=E5=92=8C?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 4 ++-- README.md | 4 ++-- entry/src/main/ets/view/PublicFilesTab.ets | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.en.md b/README.en.md index df8005c..2013e3c 100644 --- a/README.en.md +++ b/README.en.md @@ -9,8 +9,8 @@ Learn how to implement file management, including saving and reading app files, ## Concepts - Files manager: provides APIs for file operations, including accessing and managing files and directories, obtaining file information, and reading and writing data using streams. (**@ohos.file.fs**) -- Picker: encapsulates APIs such as **PhotoViewPicker**, **DocumentViewPicker**, and **AudioViewPicker** for you to pick and save files. (**@ohos.file.picker**) -- Photo manager: provides the photo management capabilities, including creating an album, and accessing and modifying media data in the album. (**@ohos.file.photoAccessHelper**) +- Picker: encapsulates APIs such as **DocumentViewPicker**, and **AudioViewPicker** for you to pick and save files. (**@ohos.file.picker**) +- Photo manager: provides the photo management capabilities, including creating an album, and accessing and modifying media data in the album, and **PhotoViewPicker**. (**@ohos.file.photoAccessHelper**) - PhotoViewPicker: allows you to pick and save images and videos. - DocumentViewPicker: allows you to pick and save documents in different formats. diff --git a/README.md b/README.md index 4042127..4f70346 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ ## 相关概念 - 文件管理能力:该模块为基础文件操作API,提供基础文件操作能力,包括文件基本管理、文件目录管理、文件信息统计、文件流式读写等常用功能。(@ohos.file.fs) -- 选择器: 选择器(Picker)是一个封装PhotoViewPicker、DocumentViewPicker、AudioViewPicker等API模块,具有选择与保存的能力。(@ohos.file.picker) -- 相册管理模块:该模块提供相册管理模块能力,包括创建相册以及访问、修改相册中的媒体数据信息等。(@ohos.file.photoAccessHelper) +- 选择器: 选择器(Picker)是一个封装DocumentViewPicker、AudioViewPicker等API模块,具有选择与保存的能力。(@ohos.file.picker) +- 相册管理模块:该模块提供相册管理模块能力,包括创建相册以及访问、修改相册中的媒体数据信息以及PhotoViewPicker等。(@ohos.file.photoAccessHelper) - PhotoViewPicker:图库选择器对象,用来支撑选择图片/视频和保存图片/视频等用户场景。 - DocumentViewPicker:文件选择器对象,用来支撑选择和保存各种格式文档。 diff --git a/entry/src/main/ets/view/PublicFilesTab.ets b/entry/src/main/ets/view/PublicFilesTab.ets index 0f92e5c..5dfae59 100644 --- a/entry/src/main/ets/view/PublicFilesTab.ets +++ b/entry/src/main/ets/view/PublicFilesTab.ets @@ -53,7 +53,7 @@ export struct publicFilesTab { Logger.info('createAsset successfully, uri: ' + uri); // Open the created media file and read the local file and convert it to ArrayBuffer for easy filling. let file = await fileIo.open(uri, fileIo.OpenMode.READ_WRITE); - let buffer = this.getUIContext().getHostContext()!.resourceManager.getMediaContentSync($r('app.media.img').id); + let buffer = context!.resourceManager.getMediaContentSync($r('app.media.img').id); // Write the read ArrayBuffer to the new media file. let writeLen = await fileIo.write(file.fd, buffer.buffer); Logger.info('write success,len=' + writeLen); -- Gitee