blobs can only be downloaded to the Download directory (now fixed in V2.3)
To get the file, the html has to be on a server - somewhere (although in more recent testing, things did appeaar to be working correctly for a local (in assets) html file on companion)
I used my text-doc-saf extension to read the file, the download happens "outside" the app so the app does not have any rights to view the file, unless you use saf. media files may behave differently.
If localhost is used (assets) for the same html file, it fetches the text directly to the browser. Not sure how this would work with other file formats.
Thank you very much for the WebViewExtra extension — it's an excellent piece of work.
As shown in the image, I'm changing the default name of the downloaded file. I have 2 questions, and if it's not too much trouble, a small request as well.
1- Is it possible to change the name of the downloaded file only through your extension? (Perhaps this could be added as a new feature?)
2- Without using SAF, is it possible to first let the user pick the save location, and then trigger the actual save afterwards?
No, and not a feature I will be working on, this can be done after the file is downloaded.
The wve extn allows you to set one of three download locations (Download/Documents/ASD). You can move the downloaded file wherever you want after it is downloaded.
Problem:
When I click on a download link (acap.one/meme), the app freezes and shows the Android message: "App isn't responding" (Wait / Close app). And the file never downloads.
Will you help me understand how to implement file downloads using WebViewExtra/WebViewer?
Can you say where in acap.one and what (on what page/what "meme") you are attempting to download?
OK, found you are using a meme generator at acap.one/meme.
The download link appears to be a base64 datauri image, in the format:
data:image/png;base64,iVBORw0KGgoAAAAN.....
which to webviewextra appears as a string, not a fully qualified path to a file, and therefore does not know how to handle it (as far as I can tell), the DownloadManager has no native method to deal with datauris. I have not come across this yet as a download format/method, will have to see if it is possible to include it.
By the by:
Latest version of webviewextra is in fact V2.32, unless of course you want to be using camera and microphone access, in which case V2.3 is correct..
In this update it is now possible to download datauris to Download, Documents or ASD. Downloaded files are given a timestamped (thus sequential) filename like this: datauri_1778746072615.ext. The file extension should be provided by the downloading site. You will get a toast message about the download, but no notifications.
In this update it is now possible to return the url for an image if it is long pressed on a webpage in the webviewer. This can then be used to view the image or download it to the app. It will also return the base64 for images that are datauri base64. Image types of jpg, png and webp are generally the most useful for further processing in an Appinventor app.
Additional Blocks:
Use this block to set/unset the long click functionality on the web page: