Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-85426

WebView wont allow fileupload

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.14.2
    • WebView
    • None
    • Anroid , Samsung Note - 5 Device
    • Android

    Description

      The current webview implementation does not allow  file upload via
      HTML <input type="file"> tags.

      I have created a patch that overrides onShowFileChooser  of WebChromeClient

      used in WebView.

       
       
      https://developer.android.com/reference/android/webkit/WebChromeClient#onShowFileChooser(android.webkit.WebView,%20android.webkit.ValueCallback%3Candroid.net.Uri[]%3E,%20android.webkit.WebChromeClient.FileChooserParams)
       
      And it seems to work.
      But this implementation requires startActivityForResult  with intent Intent.ACTION_CHOOSE
      and a matching onActivityResult implementation. As a result it requires more work on
      part of developer to  use a custom class in place of QtActivity for the main activity
      of app. The custom class is required so that onActivityResult can be overridden.
       
      Are there better ideas to implement it?
       
      I explored Fragments inside QtAndroidWebViewController.java but it seems to
      require android support package or androidx.
       
       
       
       
       
       
       
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stromme Christian
            mallah.rajesh Rajesh Kumar
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes