Skip to content

@capgo/capacitor-file-sharer

Share and save files with native sheets, Android MediaStore, and browser downloads.

@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.

  • 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.
PlatformShare behaviorSave behavior
AndroidUses 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.
iOSUses UIActivityViewController with base64 or direct path-backed files.Opens the native share sheet so the user can choose Save to Files or another destination.
WebDownloads the file.Downloads the file.
MethodDescription
shareShare a file using the native share sheet on Android and iOS, or download on Web.
saveSave a file locally on Android/Web, or open the iOS save/share sheet.
getPluginVersionReturns the platform implementation version marker.

This reference is synced from src/definitions.ts in capacitor-file-sharer.