An application can share a file with another application based on the uniform resource identifier (URI) of the file.
Based on the sharing method of file picker (startAbility), an app can share a single file and grant read-only or read/write permissions to other apps through the wantConstant.Flags API of ohos.app.ability.wantConstant. The receiving app can open the URI through fileIo.open and perform read/write operations.
The file URIs are in the following format:
file://<bundleName>/<path>
file: indicates a file URI.
bundleName: specifies the owner of the file, that is, the application that shares the file.
path: specifies the application sandbox path of the file.