using axway appcelerator Webview how can I download a file to the device

136 Views Asked by At

I am using Axway AppceleratorStudio sdk version 7.5.0.GA on Android and IOS.

I am rendering remote websites using the webview component. The website has a file URL that when clicked should download the file (usually pdf or excel).

I am unable to download the file within the webview to the mobile device. The same link works on the mobile web browser.

On IOS the file gets downloaded and displayed within the webview itself which is not what i want. I would like the file to be downloaded to the device storage.

On Android clicking the download link does nothing even though I have the storage permissions enabled (WRITE_EXTERNAL_STORAGE)

Any suggestions?

1

There are 1 best solutions below

1
miga On

Try to intercept the click (eg. beforeLoad event) pause it and download the file with a normal HTTPClient inside Titanium.