iOS Question Can't select file from "Choose File" button in webview

jjung

Member
Licensed User
Hi,
I have webpage that has "FileUpload" control.I display that page on webview control and see "Choose File" button.when click this button it does not open studio to select file for uplaod.

I find solution in B4A by use the webviewextras and addWebChromeClient method. I checked in Forums and I didn't find webviewextras in B4i. Can you advise to me how to fix this issue in B4i.

Link of B4A solution: https://www.b4x.com/android/forum/threads/webview-and-fileupload-problem.16975/

Thank you..
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It should let the user choose a photo or an iCloud document. Try it with this code:
B4X:
#PlistExtra:<key>NSPhotoLibraryUsageDescription</key><string>Select a photo.</string>
#PlistExtra:<key>NSCameraUsageDescription</key><string>Taking a photo.</string>

Sub Process_Globals
   Public App As Application
   Public NavControl As NavigationController
   Private Page1 As Page

   Private WebView1 As WebView
End Sub

Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   Page1.Title = "Page 1"
   Page1.RootPanel.LoadLayout("1")
   NavControl.ShowPage(Page1)
   WebView1.LoadUrl("https://b4x.com:51041/websocket_with_fileupload/index.html")
End Sub
 
Upvote 0
Top