Capacitor plugin to open a file with the default application.
If you are an Insider, see Getting started with Insiders and follow the instructions to install the plugin.
If you are not an Insider, please install the package from the public npm registry:
npm install @capawesome-team/capacitor-file-opener
npx cap sync
No configuration required for this plugin.
A working example can be found here: robingenz/capacitor-plugin-demo
Android | iOS |
---|---|
import { FileOpener } from '@capawesome-team/capacitor-file-opener';
const open = async () => {
await FileOpener.openFile({
path: 'file:///var/mobile/Containers/Data/Application/22A433FD-D82D-4989-8BE6-9FC49DEA20BB/Images/test.png'
});
};
openFile(options: OpenFileOptions) => Promise<void>
Open a file with the default application.
Only available on Android and iOS.
Param | Type |
---|---|
options |
OpenFileOptions |
Since: 0.0.1
Prop | Type | Description | Since |
---|---|---|---|
path |
string |
The path of the file. | 0.0.1 |
mimeType |
string |
The mime type of the file. If not specified, the mime type will be determined. | 0.0.1 |
See CHANGELOG.md.
See LICENSE.