ion-input type file only work on ios, not on andro

2019-08-25 03:47发布

问题:

I have code like this <ion-input type="file" accept=".pdf,.doc,.docx" [(ngModel)]="data.files"></ion-input>

and I try on ios it's work can choose file, but why not work on android? on android not have error, just when I click the button, the view scrolling down for sometimes and back to pervious view before scrolling down

回答1:

Input type=file won't work on mobile. Here is the reference https://forum.ionicframework.com/t/upload-file-with-input-type-file-but-get-it-with-file-path/100043/2

You can use cordova plugins like fileChooser, FilePicker-Phonegap-iOS-Plugin.