S Seung Lee New Member Licensed User Oct 18, 2018 #1 I searched most of community pages for 2 weeks, but I couldn't find a solution. Is there anyone who can make file upload possible in webview?
I searched most of community pages for 2 weeks, but I couldn't find a solution. Is there anyone who can make file upload possible in webview?
Erel B4X founder Staff member Licensed User Longtime User Oct 18, 2018 #2 Why do you need to do it through WebView? Will be much simpler to do it directly. Upvote 0
S Seung Lee New Member Licensed User Oct 18, 2018 #3 I am making a web app using my existing mobile web site. Because I have to use the Upload File feature of my existing mobile site, The webview or webviewexrtas function should be implemented. Last edited: Oct 19, 2018 Upvote 0
I am making a web app using my existing mobile web site. Because I have to use the Upload File feature of my existing mobile site, The webview or webviewexrtas function should be implemented.
Erel B4X founder Staff member Licensed User Longtime User Oct 19, 2018 #4 As an alternative you can catch the file upload request and make it yourself with OkHttpUtils2. Upvote 0
T theunis Member Licensed User Oct 22, 2018 #5 I am sitting with exactly the same problem - @Erel if you say use OkHttpUtils2 you lose me completely - first time poster, bought b4x last month, using it for about 3 days so it is more treading water in order not to drown than swimming at the moment. Upvote 0
I am sitting with exactly the same problem - @Erel if you say use OkHttpUtils2 you lose me completely - first time poster, bought b4x last month, using it for about 3 days so it is more treading water in order not to drown than swimming at the moment.
KMatle Expert Licensed User Longtime User Oct 22, 2018 #6 So you are dealing with servers 3 days after you started? Well... However. Take a search for "upload files" and you'll find everything you need. Upvote 0
So you are dealing with servers 3 days after you started? Well... However. Take a search for "upload files" and you'll find everything you need.
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2018 #7 theunis said: @Erel if you say use OkHttpUtils2 you lose me completely Click to expand... Using OkHttpUtils2 is quite simple: [B4X] OkHttpUtils2 with Wait For Upvote 0
theunis said: @Erel if you say use OkHttpUtils2 you lose me completely Click to expand... Using OkHttpUtils2 is quite simple: [B4X] OkHttpUtils2 with Wait For
T theunis Member Licensed User Oct 22, 2018 #8 KMatle said: So you are dealing with servers 3 days after you started? Well... However Click to expand... what do you mean? been using B4A for a couple of days does that clarify it for you? and I did go through the forum same as Seung Lee "I searched most of community pages for 2 weeks, but I couldn't find a solution.Is there anyone who can make file upload possible in webview?" It seems I'm not the only one that have the problem and cant get it to work. Upvote 0
KMatle said: So you are dealing with servers 3 days after you started? Well... However Click to expand... what do you mean? been using B4A for a couple of days does that clarify it for you? and I did go through the forum same as Seung Lee "I searched most of community pages for 2 weeks, but I couldn't find a solution.Is there anyone who can make file upload possible in webview?" It seems I'm not the only one that have the problem and cant get it to work.
T theunis Member Licensed User Oct 22, 2018 #9 Erel said: Using OkHttpUtils2 is quite simple: [B4X] OkHttpUtils2 with Wait For Click to expand... @Erel ok - on a normal website I have a form that collects X information plus the user can upload a image while adding the record - so in my webview I have the form as well where does the Okhttpustils fit into this scenario to upload the file and the file name being stored in the new record to retrieve it later? The problem is I just dont see how it is done and how the code flow is for it. A well explained example will help the 8+ people on the forum that seems to have that exact problem. PS. I checked if I deploy as SDK version 5/19 (must check but it was there roundabout) as per another struggling user it actually works and the upload button will give you the option to get a file form device and upload it. Upvote 0
Erel said: Using OkHttpUtils2 is quite simple: [B4X] OkHttpUtils2 with Wait For Click to expand... @Erel ok - on a normal website I have a form that collects X information plus the user can upload a image while adding the record - so in my webview I have the form as well where does the Okhttpustils fit into this scenario to upload the file and the file name being stored in the new record to retrieve it later? The problem is I just dont see how it is done and how the code flow is for it. A well explained example will help the 8+ people on the forum that seems to have that exact problem. PS. I checked if I deploy as SDK version 5/19 (must check but it was there roundabout) as per another struggling user it actually works and the upload button will give you the option to get a file form device and upload it.
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2018 #10 The actual details depend on the specific site. In most cases it will be a multipart request that should be sent with Job.PostMultipart. The first step is to use the browser developer tools and understand the request that is being sent when you upload the file. Upvote 0
The actual details depend on the specific site. In most cases it will be a multipart request that should be sent with Job.PostMultipart. The first step is to use the browser developer tools and understand the request that is being sent when you upload the file.
T theunis Member Licensed User Oct 22, 2018 #11 ok erel, but the sh*t hits the fan long before the actual upload / from the webview we need to be able to pick an image on the mobile (or from camera) just as HTML lets you do only then we need the upload section - it is the file pick dialog where the issue is. Upvote 0
ok erel, but the sh*t hits the fan long before the actual upload / from the webview we need to be able to pick an image on the mobile (or from camera) just as HTML lets you do only then we need the upload section - it is the file pick dialog where the issue is.
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2018 #12 Letting the user pick an image is quite simple with ContentChooser. If you can avoid using WebView then you will have more control and it will be simpler. Upvote 0
Letting the user pick an image is quite simple with ContentChooser. If you can avoid using WebView then you will have more control and it will be simpler.
Erel B4X founder Staff member Licensed User Longtime User Oct 25, 2018 #13 An example is now available: Upload files with WebView Upvote 0