@capgo/capacitor-file-picker

June 16, 2026 ยท View on GitHub

Capgo - Instant updates for Capacitor

โžก๏ธ Get Instant updates for your App with Capgo

Missing a feature? We'll build the plugin for you ๐Ÿ’ช

File picker Capacitor plugin - Pick files, images, videos, and directories

Why Capacitor File Picker?

A comprehensive file picker plugin with full native support for iOS and Android:

  • Pick Files - Select any file type with MIME type filtering
  • Pick Images - Native photo library picker with multi-select
  • Pick Videos - Native video picker with duration and dimensions
  • Pick Media - Combined image and video picker
  • Pick Directory - Select folders (Android/iOS)
  • HEIC to JPEG - Convert HEIC images to JPEG (iOS only)
  • Copy Files - Copy files to new locations
  • File Metadata - Get size, dimensions, duration, and more

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/file-picker/

Compatibility

Plugin versionCapacitor compatibilityMaintained
v8.*.*v8.*.*โœ…
v7.*.*v7.*.*On demand
v6.*.*v6.*.*โŒ
v5.*.*v5.*.*โŒ

Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.

Install

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-file-picker` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

npm install @capgo/capacitor-file-picker
npx cap sync

Requirements

  • iOS: iOS 15.0+
  • Android: API 24+ (Android 7.0+)
  • Web: Modern browsers with File API support

Android media permissions and Google Play review

This plugin is designed around user-selected picker flows such as pickFiles(), pickImages(), pickVideos(), pickMedia(), and pickDirectory(). For one-time or infrequent file, image, or video selection, use these picker methods and avoid adding broad media permissions to your app manifest.

Google Play only allows READ_MEDIA_IMAGES and READ_MEDIA_VIDEO when photo or video access is directly related to your app's core purpose and picker alternatives are not sufficient. Do not request or retain these permissions only to let a user choose files, images, or videos.

Before publishing an app that declares these permissions:

  • Make sure broad photo or video library access is required for the app's core functionality.
  • Be ready to justify why Android Photo Picker or this plugin's picker methods are not sufficient.
  • Remove broad media permissions if the app can work with user-selected files only.

If Google Play review rejects the app with a message like Photo and Video Permissions policy: Permission use is not directly related to your app's core purpose, remove the broad media permissions and rely on this plugin's picker APIs instead.

For apps coming from @capgo/capacitor-file, a custom media browser, or another broad-storage flow, the recommended alternative is @capgo/capacitor-file-picker with pickImages(), pickVideos(), pickMedia(), or pickFiles().

See Google's Photo and Video Permissions policy for the current review requirements.

API

Capacitor File Picker Plugin interface for selecting files, images, videos, and directories.

pickFiles(...)

pickFiles(options?: PickFilesOptions | undefined) => Promise<PickFilesResult>

Pick one or more files from the device.

ParamTypeDescription
optionsPickFilesOptions- Options for picking files

Returns: Promise<PickFilesResult>

Since: 8.0.0


pickImages(...)

pickImages(options?: PickMediaOptions | undefined) => Promise<PickFilesResult>

Pick one or more images from the gallery. Android/iOS only.

ParamTypeDescription
optionsPickMediaOptions- Options for picking images

Returns: Promise<PickFilesResult>

Since: 8.0.0


pickVideos(...)

pickVideos(options?: PickMediaOptions | undefined) => Promise<PickFilesResult>

Pick one or more videos from the gallery. Android/iOS only.

ParamTypeDescription
optionsPickMediaOptions- Options for picking videos

Returns: Promise<PickFilesResult>

Since: 8.0.0


pickMedia(...)

pickMedia(options?: PickMediaOptions | undefined) => Promise<PickFilesResult>

Pick one or more images or videos from the gallery. Android/iOS only.

ParamTypeDescription
optionsPickMediaOptions- Options for picking media

Returns: Promise<PickFilesResult>

Since: 8.0.0


pickDirectory()

pickDirectory() => Promise<PickDirectoryResult>

Pick a directory from the device. Android/iOS only.

Returns: Promise<PickDirectoryResult>

Since: 8.0.0


convertHeicToJpeg(...)

convertHeicToJpeg(options: ConvertHeicToJpegOptions) => Promise<ConvertHeicToJpegResult>

Convert a HEIC image to JPEG format. iOS only.

ParamTypeDescription
optionsConvertHeicToJpegOptions- Options for the conversion

Returns: Promise<ConvertHeicToJpegResult>

Since: 8.0.0


copyFile(...)

copyFile(options: CopyFileOptions) => Promise<void>

Copy a file to a new location.

ParamTypeDescription
optionsCopyFileOptions- Options for copying the file

Since: 8.0.0


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Check broad storage or media permission state. Picker-only flows should not gate pickFiles(), pickImages(), pickVideos(), or pickMedia() on this permission on Android 13+. Android only.

Returns: Promise<PermissionStatus>

Since: 8.0.0


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Request broad storage or media permissions. Do not request or declare READ_MEDIA_IMAGES or READ_MEDIA_VIDEO only to use picker APIs. Google Play allows these permissions only when picker alternatives are not sufficient for core app functionality. Use @capgo/capacitor-file-picker picker methods instead for user-selected file, image, or video access. Android only.

Returns: Promise<PermissionStatus>

Since: 8.0.0


addListener('pickerDismissed', ...)

addListener(eventName: 'pickerDismissed', listenerFunc: PickerDismissedListener) => Promise<PluginListenerHandle>

Add a listener for the picker dismissed event. iOS only.

ParamTypeDescription
eventName'pickerDismissed'- The event name
listenerFuncPickerDismissedListener- The listener function

Returns: Promise<PluginListenerHandle>

Since: 8.0.0


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 8.0.0


getPluginVersion()

getPluginVersion() => Promise<{ version: string; }>

Get the native Capacitor plugin version.

Returns: Promise<{ version: string; }>

Since: 8.0.0


Interfaces

PickFilesResult

Result of picking files.

PropTypeDescription
filesPickedFile[]Array of picked files

PickedFile

Represents a picked file.

PropTypeDescription
namestringThe name of the file
pathstringThe path to the file
mimeTypestringThe MIME type of the file
sizenumberThe size of the file in bytes
datastringThe base64 encoded data of the file. Only present if readData was true.
blobBlobThe Blob instance of the file. Web only.
widthnumberWidth in pixels (images/videos only)
heightnumberHeight in pixels (images/videos only)
durationnumberDuration in seconds (videos only)
modifiedAtnumberLast modified timestamp in milliseconds

PickFilesOptions

Options for picking files.

PropTypeDescriptionDefault
typesstring[]List of accepted MIME types or file extensions. On iOS, only MIME types are supported. Examples: ['image/*'], ['application/pdf'], ['.pdf', '.doc']
limitnumberMaximum number of files to pick. Set to 0 for unlimited (platform default).0
readDatabooleanWhether to read the file data as base64. Note: Reading large files may cause memory issues.false

PickMediaOptions

Options for picking media (images/videos).

PropTypeDescriptionDefault
limitnumberMaximum number of files to pick. Set to 0 for unlimited (platform default).0
readDatabooleanWhether to read the file data as base64. Note: Reading large files may cause memory issues.false
skipTranscodingbooleaniOS only: Skip transcoding of videos.false
orderedbooleaniOS 15+ only: Show ordered selection badges.false

PickDirectoryResult

Result of picking a directory.

PropTypeDescription
pathstringThe path to the selected directory

ConvertHeicToJpegResult

Result of HEIC to JPEG conversion.

PropTypeDescription
pathstringThe path to the converted JPEG file

ConvertHeicToJpegOptions

Options for converting HEIC to JPEG.

PropTypeDescriptionDefault
pathstringThe path to the HEIC file to convert
qualitynumberThe compression quality for JPEG (0.0 - 1.0).0.9

CopyFileOptions

Options for copying a file.

PropTypeDescriptionDefault
fromstringSource file path
tostringDestination file path
overwritebooleanWhether to overwrite if destination exists.false

PermissionStatus

Permission status for file access.

PropTypeDescription
readExternalStoragePermissionStateWhether broad external storage or media permission is granted. Picker APIs that return user-selected files usually do not require this on Android 13+.
accessMediaLocationPermissionStateWhether permission to access media location is granted

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

PickerDismissedListener

Listener callback for picker dismissed event.

(event: null): void