Closed alexoleynik22 closed 9 years ago
Thanks for this feature request!
You're right, this would definitely be nice to have. Unfortunately, it may not be that easy to implement.
onShowFileChooser()
method that this library implements, we can just check whether fileChooserParams.isCaptureEnabled()
is set to true
. In addition, one can use fileChooserParams.getAcceptTypes()
to check whether an image, a video or audio should be captured.openFileChooser()
version that has three parameters, which this library implements as well. The second parameter, acceptType
, again lets us detect whether image, video or audio is requested. The third parameter, capture
, seems to be set to filesystem
by default. It just takes what was set in the capture=""
attribute in HTML. The problem is that you cannot distinguish an empty capture
attribute from a missing capture
attribute: In both cases, the parameter in Android will be set to filesystem
.fileChooserParams.isCaptureEnabled()
which is reliable.android.permission.WRITE_EXTERNAL_STORAGE
, create the file in advance and then pass this file to the component taking the photo so that it can save the captured image there.All in all, you see that this is not that easy. For the normal file picker, we can provide this out of the box and it doesn't require any permissions or adjustments. But for these content capture methods, things look different.
Here you can find a snippet for capturing an image on Android 5.0 after the file input has been opened.
Awesome thank you for great reply can't wait to try this out. For my project I need to upload audio recorded from voice recorder which one built-in in android. But so far no luck even on lollipop but I feel like I was doing something wrong. Thank you again
hello there am using the advanced WebView but it doesnt allow me to upload a file or image.wen i click on upload,nothing shows up.the page is just still... please help me fix issue
Thanks for your feedback, @augustusbuckman! Maybe you should create a separate issue for this. We can discuss your specific problem there after you have created the new issue :) Please include information about the Android version that you're testing this on. Thank you!
Hi, I was trying to use your script to fix the problem with filechooser for example: if I open this page in the browser http://www.francesco.iovine.name/w3c/mediacapture/ and try to upload something it's works the way it should.
But in your script it takes me to the choose a recent document instead of choose an application to complete the action. Like Camera or Audio Recorder.
I feel like I'm doing something wrong, but want to make sure, I spend so much time on this problem, all I'm trying to do is to load one page inside the app and make input field work the way it should.
I would appreciate for any help. Thank you