Download a file from web view in mendix native application

0
Hello Team, I have a web view on the Mendix native page. In that web view, I just call a web page and I am showing a list of file docs from mendix db. now I am using download file activity which I am using in a microflow. when I click the file download it redirects to Chrome and cannot reach the page. but I need to download the file directly to my mobile from the web view. I have no idea. so help me to resolve this. thanks in advance
asked
1 answers
0

Hi Palanivelrajan P

 

 There are 3 methods which you can achieve this

 

 Method1: Construct the file url from the app web and pass the file url via 

window.ReactNativeWebView.postMessage(imageUrl); then use native-fs to download the file directly but remember the Session_Auth should be avaible.

 

Method2: Convert the file into base64 and pass it to native via window.ReactNativeWebView.postMessage(imageUrl); then reconstruct the file in mobile[ preferred if the file size is less]

 

Method3: Get the file ID from web view and download it via a exposed API 

 

I hope this helps!!

answered