Webview and fileupload problem

dadi4

Member
Licensed User
Longtime User
Hi,

I have asp.net 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
 

warwound

Expert
Licensed User
Longtime User
Hi there.

Take a look at my WebViewExtras library, specifically it's addWebChromeClient method.


I'm not sure whether a file upload dialog is part of the default WebChromeClient that that method creates, try it and report back.

If there's a way to enable a file upload dialog i can try and implement it.

Martin.
 
Upvote 0

dadi4

Member
Licensed User
Longtime User
hi,

I used webviewextras addWebChromeClient method and still same problem

(thank you for reply)
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Good news i think....

I've attached some sample code and an updated version of WebViewExtras to this post.

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim WebView1 As WebView
   Dim WebViewExtras1 As WebViewExtras
End Sub

Sub Activity_Create(FirstTime As Boolean)
   WebView1.Initialize("WebView1")
   WebViewExtras1.addWebChromeClient(WebView1)
   
   Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
   
   WebView1.LoadUrl("http://cgi-lib.berkeley.edu/ex/fup.html")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

I've tested it on the emulator (Froyo) and it seems to work ok.

Can you give it a test and report back?
Be sure to let me know what version(s) of Android you are testing with please.

Note that the attached version of WebViewExtras is just an alpha version and i'd rather you didn't use it ongoing.
As long as you report that it works ok then i'll finish off the update and get it uploaded to the libraries forum.

(Do not try to use the WebView Tag property with this alpha version - it will likely crash your application).

Martin.
 
Last edited:
Upvote 0

dadi4

Member
Licensed User
Longtime User
its indeed good new, work like sharm

many thanks for library update and help
 
Last edited:
Upvote 0

warwound

Expert
Licensed User
Longtime User
Great i'll put the finishing touches to the update later and get it uploaded.

Be sure to get the proper update when i upload it - the version i posted earlier will cause problems if your app uses the WebView Tag property, otherwise it 'should' be ok.

Martin.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…