Yes, it should be possible. In your case, the URL looks like once the blob: prefix is ββremoved, and the rest is decoded by the URL:
blob: http: //digitalinsensu.com/0f0d6127-a0f1-44c3-af85-72f648258d6d
Remember that this URL will only work if the user has a web server running on his device that responds to requests , which is unlikely in the case of blob: URL . If you want to do this, you must first remove blob: using Java String.replace(..) or similar. To decode a URL, use something like URLDecoder.decode(url, "UTF-8"); see here for details.
The problem is that DownloadListener really expecting a URI (ex http://server.com/file.pdf ). However, the link that the user clicks on does not skip URIs in this format. The missing URL is a blob that is bound to the browser DOM . As a result, the solution will not work as designed.
You may have another option. It depends on how you generate bytes for blob. You mentioned that you are doing this in Javascript. If so, I would skip the full use of Blob and URL.createObjectURL and write a Javascript/Native interface that will allow you to pass bytes in chunks (for example, the number of arrays is 255 bytes) into Java code. This will reduce memory consumption on the client.
I have an idea on how to create an interface, but first I need to understand how you generate bytes for blob. If you can send an array of bytes, I can try to continue.
Read more about this check here.
source share