@capgo/capacitor-file-sharer
Share and save files with native sheets, Android MediaStore, and browser downloads.
Overview
Section titled “Overview”@capgo/capacitor-file-sharer shares or saves files from base64 data, data URLs, local file paths, file:// URLs, content:// URIs, and Capacitor _capacitor_file_ URLs.
Use it when an app needs to export reports, backups, images, videos, PDFs, ZIP archives, or other generated files without forcing every platform through the same storage path.
Core Capabilities
Section titled “Core Capabilities”share- Open the native share sheet on Android and iOS, or download the file on Web.save- Save into Android public collections, open the iOS save/share sheet, or download on Web.getPluginVersion- Return the native/web plugin implementation version.
Platform Behavior
Section titled “Platform Behavior”| Platform | Share behavior | Save behavior |
|---|---|---|
| Android | Uses a FileProvider, ClipData, and URI grants so chooser previews and thumbnails can read the file. | Uses MediaStore on Android 10+ and public directories on Android 9 and below. |
| iOS | Uses UIActivityViewController with base64 or direct path-backed files. | Opens the native share sheet so the user can choose Save to Files or another destination. |
| Web | Downloads the file. | Downloads the file. |
Public API
Section titled “Public API”| Method | Description |
|---|---|
share | Share a file using the native share sheet on Android and iOS, or download on Web. |
save | Save a file locally on Android/Web, or open the iOS save/share sheet. |
getPluginVersion | Returns the platform implementation version marker. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-file-sharer.