mgks / Android-SmartWebView

A simple use webview integrated w/ native features to help create most advanced hybrid applications.
https://mgks.dev/smart-webview
MIT License
571 stars 278 forks source link

Image upload gets .3gp extension when video is also available #190

Closed amanzan closed 3 years ago

amanzan commented 4 years ago

Testing file upload, I got both image and video available inside intent chooser.

Take a picture, upload it, and it gets the video extension .3gp

mgks commented 4 years ago

must a issue of file type selection.

amanzan commented 4 years ago

@mgks no, it's because you use the same variable asw_cam_message for both photo and video, and the video is the last one to set up. So if photo and video are both present and you select a photo, it will always have the video extension. The only solution I found is to use 2 different variables for photo and video, and create my own dialog to know what upload option user selects

mgks commented 4 years ago

well, I've fixed it as you suggested but it has been mentioned several times in this forum to use file accept type in input, so it becomes intuitive for system to decide whether to activate camcorder or camera. You must be allowing all file types to go through a single input without filtering and I suppose there must be more people doing the same.

Thanks for noticing it anyway.