🟨 WebViewExtra - Upload/Download Files with webviewer

Can I use your extension and the standard webviewer together? Because I need to clear cache when opening the webviewer every time.

My extension requires the native webviewer, it enhances the webviewer's functionality.

2 Likes

Ok, thank you for your response

Update 1.71.release

Added a fix which hopefully resolves the Broadcast Receiver export issue with API 34 / Android 14.

Can be downloaded from the link in the first post of the topic.

Update 1.8.release

webviewextra should now allow you to download files from blob urls. You will not get a notification like you do with ordinary downloads, and because blob urls generally do not have a filename, a filename is created using the format file_currentMilliseconds.ext.

This functionality has taken over two years to apply, much digging and searching on the internet finally resolved with this post in July 2024

Download the file with blob URL in Android WebView - Tech Blogs

1 Like

Por favor, tenho um webview configurado para abrir uma url ao iniciar. Alguém pode enviar imagens da configuração para download deste site.

Just click on the link to download the file in your web page, it should start downloading.

1 Like

Muito obrigado, funcionou.

Hello, I would like to ask if it is possible to have an option not automatically download the files but instead pass the URL to an event?

That could be tricky, very often urls are obfuscated/dynamically generated within the standing website that would mean nothing as a url back in the app, e.g. blob urls. I have no real desire to include such functionality (things are complicated enough !).

It may be possible to do what you want with the CustomWebView extension ?

Ah, I guess it is. It just wasn't very clear on how to utilize the CustomWebView extension. I'll look more into it, thanks!

Hi @TIMAi2 I really like your extension and currently I am using it on my project, your extension works very well and there are no problems, it's just that I am confused why the "when WebviewExtra.Downloaded" block does not work as I expected, which is when the download file is complete, the event should be triggered, but instead the event is triggered when the download just started. If that's how it works, is it possible for you to add an event that can be triggered when the download is completed?

I had a problem in the code, with the downloaded not working 'after' the download. So had to move it before. There are unlikely situations where the actual download will not occur but you get the downloaded event.

To compensate for this, you could run a FileExists test using the File component.

When I have the time and motivation I will figure out the issue, and get things working in the correct order and as they should!

1 Like

Hi, Please let me know if you will be releasing an update for the below compliance need by google.

In October 2023, we announced the Photo and Video Permissions policy to enhance user privacy by limiting the number of apps with access to broad photo and video permissions (READ_MEDIA_IMAGES and READ_MEDIA_VIDEO). Starting January 22, 2025, your app must comply with this policy.8

1 Like

In what way is the webviewextra extension contravening the google policy for Photo and Video permissions ?

Try this, see what happens

uk.co.metricrat.webviewextra1.8.2beta.aix (23.4 KB)

(now only READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions declared in the manifest, no other permissions.For beta testing. Uploads and Downloads working for me when compiled on Android 15)

Correct me if I'm wrong, I think you've made READ/WRITE provisions to access MEDIA images, video. 3rd bullet in the below link

sets READ and WRITE and MEDIA permissions in the app / aia project, enabling the setting of Legacy as a default filescope for storage of files in Shared directories.

See above, MEDIA permissions removed. Please test (in app and on Google Play Store). The extension uses SAF (ACTION_OPEN_DOCUMENT) which is the fallback if Android File Picker is not available.

1 Like

Sure. will test and let you know. Thanks!

Now updated to V1.8.2 in first post.

Thanks @TxSolve for the heads up.

Update to version 1.9

allows autoplay of media (audio/video) with sound