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

WebView wont allow fileupload

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.2
    • Fix Version/s: None
    • Component/s: WebView
    • Labels:
      None
    • Environment:
      Anroid , Samsung Note - 5 Device
    • Platform/s:
      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

            Assignee:
            stromme Christian
            Reporter:
            mallah.rajesh Rajesh Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes