Tahlil
Tahlil

Reputation: 1091

Ionic 4 Capacitor Choose file for Android and IOS

I was developing an app in ionic 4 using Capacitor for android and IOS. I can't find any way to choose a file using Capacitor's api. I had looked for method in the Capacitor's "Filesystem" api (https://capacitor.ionicframework.com/docs/apis/filesystem/) but could not find any that would allow me th choose file. Is there any other way I can choose file from android or IOS device using ionic 4 with Capacitor?

Upvotes: 1

Views: 3859

Answers (2)

Hinddeep S. Purohit
Hinddeep S. Purohit

Reputation: 49

You can use the plugin I've developed: https://github.com/hinddeep/capacitor-file-selector

  1. Allows the developer to specify whether the user can select single or multiple files
  2. Lends the ability to restrict the user to select files conforming to a given set of extensions
  3. Lends the ability to restrict the user to select files conforming to a broader category of multimedia files, i.e. Audios, Videos and Images
  4. Supported Platforms: Android (is compatible with Android 10+'s scoped storage), iOS and Web

Upvotes: 0

jcesarmobile
jcesarmobile

Reputation: 53301

Just use an input with type file

<input type="file" name="myFile">

Upvotes: 4

Related Questions