October 22, 2024
Chicago 12, Melborne City, USA
Android

Android webview file upload only works once if aborted


Scenario

I have an Android app with a WebView.

The WebView is displaying a web page with a simple file upload control. The simplified code is:

<input id="photoupload" type="file" />

This HTML renders as expected in the WebView, showing a "Choose file" button. Tapping the "Choose file" button will initiate file selection successfully.

Problem

If the file selection is then aborted without selecting a file, tapping on the "Choose file" button again will no longer initiate file selection. It appears to do nothing. The upload control will no longer work.

Question:

Is there a native HTML / JS solution that I can implement in the web page, that will keep the "Choose file" button working after file selection has been aborted?

I have seen solutions involving adding code to the WebView. But I have no access to the Android app for this. I can only alter the displayed web page.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video