0.1.2-dev.0115e2b.1632990878 • Published 4 years ago

@robingenz/capacitor-file-picker v0.1.2-dev.0115e2b.1632990878

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Maintainers

MaintainerGitHubSocial
Robin Genzrobingenz@robin_genz

Installation

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

Configuration

No configuration required for this plugin.

Demo

A working example can be found here: robingenz/capacitor-plugin-demo

Usage

import { FilePicker } from '@robingenz/capacitor-file-picker';

const pickFile = async () => {
  const result = await FilePicker.pickFile();
};

API

pickFile(...)

pickFile(options?: PickFileOptions | undefined) => Promise<PickFileResult>

Open the file picker that allows the user to select a file.

ParamType
optionsPickFileOptions

Returns: Promise<PickFileResult>


Interfaces

PickFileResult

PropTypeDescription
pathstringThe path of the file. Only available on Android and iOS.
namestringThe name of the file.
datastringThe Base64 string representation of the data contained in the file.
mimeTypestringThe mime type of the file.
sizenumberThe size of the file.

PickFileOptions

PropTypeDescription
typesstring[]List of accepted file types. Look at IANA Media Types for a complete list of standard media types. Example: ['image/png', 'application/pdf']

Changelog

See CHANGELOG.md.

License

See LICENSE.