Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

community-cordova-plugin-file-chooser

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

community-cordova-plugin-file-chooser

A plugin for file chooser

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
0
Weekly downloads
 
Created
Source

I dedicate a considerable amount of my free time to developing and maintaining many Cordova plugins for the community (See the list with all my maintained plugins). To help ensure this plugin is kept updated, new features are added, and bugfixes are implemented quickly, please donate a couple of dollars (or a little more if you can stretch) as this will help me to afford to dedicate time to its maintenance. Please consider donating if you're using this plugin in an app that makes you money, or if you're asking for new features or priority bug fixes. Thank you!

FileChooserPlugin

FileChooserPlugin is a Cordova plugin that allows users to select files on Android and iOS. It provides an easy interface to pick files and get the file's path or content as a base64 encoded string.

Installation

To install the plugin, use the following command:

cordova plugin add community-cordova-plugin-file-chooser

Methods

chooseFile(options?: FileChooserOptions): Promise<string>

Presents the user with a file chooser to pick a file.

Options
  • responseType (optional): Specifies the format in which to return the selected file. Possible values are:
    • 'path' (default): Returns the file's URI path.
    • 'base64': Returns the file's content as a base64 encoded string.
  • mimeType (optional): Specifies the MIME type to filter files. Defaults to all files ('*/*').
Example
import { chooseFile } from 'community-cordova-plugin-file-chooser';

chooseFile({ responseType: 'base64', mimeType: 'image/*' })
  .then(fileData => {
    console.log('File data:', fileData);
  })
  .catch(error => {
    console.error('Error choosing file:', error);
  });

Platform Support

  • Android
  • iOS

Usage

The plugin is straightforward to use. Simply call the chooseFile() function with the desired options, and handle the result in the promise's then or catch block.

Contributing

Contributions are welcome! If you find a bug or have an idea for a new feature, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

FAQs

Package last updated on 22 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc