You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/07 11:30:03 UTC

[GitHub] [cordova-android] biodiv edited a comment on issue #816: Android clicking input type=file brings up system file browser, not camera options

biodiv edited a comment on issue #816: Android clicking input type=file brings up system file browser, not camera options
URL: https://github.com/apache/cordova-android/issues/816#issuecomment-551040176
 
 
   > You could use `cordova-plugin-camera`'s `window.navigator.camera.getPicture` to trigger the right options on android. This method will let you choose your destination using https://github.com/apache/cordova-plugin-camera#cameradestinationtype--enum.
   > 
   > Technically add an onClick listener to your tag and handle it yourself by using the above API method, that should resolve your issue.
   
   This approach works but has limitations. For example, `<input type="file">.files` is a `FileList` instance, which does not offer a `push` method (like regular Arrays) for good reasons. So, you cannot retrieve a File using the camera plugin and simply append it to `<input type="file">.files` using javascript. You have to implement your own form/file handling if you use the camera plugin.
   
   [FileList on MDN](https://developer.mozilla.org/en-US/docs/Web/API/FileList)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org