未验证 提交 031eae1d 编写于 作者: O openharmony_ci 提交者: Gitee

!17468 [翻译完成】#I6T7HG

Merge pull request !17468 from Annie_wang/PR16877
# @ohos.file.fileUri (File URI) # @ohos.file.fileuri (File URI)
The **fileUri** module allows the uniform resource identifier (URI) of a file to be obtained based on the file path. With the file URI, you can use the APIs provided by [@ohos.file.fs](js-apis-file-fs.md) to operate the file. The **fileUri** module allows the uniform resource identifier (URI) of a file to be obtained based on the file path. With the file URI, you can use the APIs provided by [@ohos.file.fs](js-apis-file-fs.md) to operate the file.
...@@ -9,7 +9,7 @@ The **fileUri** module allows the uniform resource identifier (URI) of a file to ...@@ -9,7 +9,7 @@ The **fileUri** module allows the uniform resource identifier (URI) of a file to
## Modules to Import ## Modules to Import
```js ```js
import fileUri from "@ohos.file.fileUri"; import fileuri from "@ohos.file.fileuri";
``` ```
Before using this module, you need to obtain the path of the file in the application sandbox. The following is an example: Before using this module, you need to obtain the path of the file in the application sandbox. The following is an example:
...@@ -57,5 +57,5 @@ For details about the error codes, see [File Management Error Codes](../errorcod ...@@ -57,5 +57,5 @@ For details about the error codes, see [File Management Error Codes](../errorcod
```js ```js
let filePath = pathDir + "test.txt"; let filePath = pathDir + "test.txt";
let uri = fileUri.getUriFromPath(filePath); let uri = fileuri.getUriFromPath(filePath);
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册