How-to guides
Pick and open files
Select attachments and hand native files or URLs to other apps.
Enable file capabilities
Apply capability setup for the operations you need:
| Operation | Install | Enable |
|---|---|---|
| Pick | @capawesome/capacitor-file-picker@8.1.1 | internalPlugins.filePicker |
| Open externally | @capacitor/app-launcher@8.0.1, @capacitor-community/file-opener@8.0.1 | internalPlugins.intents |
Pick attachments
Connect a button to these @akshatowo/radical/react hooks:
const picker = useFilePicker();
const intent = useIntent();
picker.pick({ types: ["application/pdf"], multiple: true });You receive files with bytes in picker.value[i].blob.
Open externally
Choose an action:
intent.openFile(file);
intent.openFile(file, { chooser: true });
intent.openUrl("https://example.com/help");Handle picker.error and intent.error separately.
Selections load into memory; avoid very large files.