2

I'm using the following input inside an Ionic app to get an image or video from the user

<input type="file" multiple #imageFileInput accept="image/*" (change)="imageFiles($event)" style="display:none;" />

However, it doesn't give them the choice of the camera as the chrome spec suggests When I add the capture attribute it ONLY opens the camera and doesn't give the choice of selecting a file. How can I set it so that the user has the choice of the camera or image from gallery?

Taylorsuk
  • 1,419
  • 1
  • 16
  • 51
  • See these comments from 2017: [Ionic File Upload using HTML5 input](https://stackoverflow.com/q/55416283/11700321) whereby the solutions suggested are: **1.** `replace: accept="image/*, .pdf, .doc, .docx" with accept="image/*, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document"` and **2.** `Use FileChooser plugin for android and IOSFilePicker plugin for ios instead of – EGC Oct 24 '19 at 23:25
  • And this example from 2018: [How to force HTML input file chooser to give the original file name in Ionic(Android)?](https://stackoverflow.com/a/49787899/11700321) - just because it has a different `accept` section to yours – EGC Oct 24 '19 at 23:27

0 Answers0