CustomWebView : An extended form of Web Viewer

url should be of resource.
If not then you'll have to check logcat.

please help, I made a WEB form APP SCRIPT application which I will make a mobile version of, the problem is when I want to download an excel file using a plugin:
ajax/libs/xlsx/0.14.3/xlsx.full.min.js

which when I download it always fails because the url becomes:
blob: https://n

and I also made an MS Word export feature which also can't be downloaded because the error file reads:
data:application/vnd.ms-word;charset=utf-8

how do i make a download file for my web app using a custom webview?

web application links:
https://script.google.com/macros/s/AKfycbxlMub33-l6OjsW6JISw83RU-yGSMP2SMk3jTN-UOzorMRUJobZ8iT2DOZInA8Sq00/exec

login:
user:demo
pass: demos

download on the user menu and pengajian menu

thanks

You cannot download a blob url using the android webview.

everything runs normally when on the computer but the download always fails when using a custom webview

Is there another solution so I can make the download feature

the excel file download url changes to: blob:https://n-kwyw4ei5ng4wc2as6camw7nhscfabxrze522nhq-0lu-script.googleusercontent.com/d11c1730-8daf-4be5-ad6e-af7daf9bae98

while the word file changes to:

data:application/vnd.ms-word;charset=utf-8,%3Chtml%20xmlns%3Ao%3D'urn%3Aschemas-microsoft-com%3Aoffice%3Aoffice'%20xmlns%3Aw%3D'urn%3Aschemas-microsoft- com%3Aoffice%3Aword'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2FTR%2FREC-html40'%3E%3Chead%3E%3Cmeta%20charset%3D'utf-8'%3E%3Ctitle %3ESIAP%20~%20abu%20musa%20computer%3C%2Ftitle%3E%3C%2Fhead%3E%3Cbody%3E%3Cp%20style%3D%22text-align%3A%20center%3B%22%3E%3Cstrong% 3REGISTER%20BOOK%20YELLOW%20WHICH%20TEACHED%3Cbr%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20AND%20TO%20REFERRAL%20SCIENCE% 3Cbr%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20PONDOK%20BOARDING SCHOOL%20CONTOH%3Cbr%3E%0A%20%20%20% 20%20%20%20%20%20%20%20%20%20%20YEARS%20STUDY%202022%2F2023%3C%2Fstrong%3E%3C%2Fp%3E%20%3Ctable%20border%3D%221% 22%20style%3D%22border-collapse%3A%20collapse%3B%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20style%3D%22width%3A%2045px%3B%20text-

Where are your excel and word files? If you store them on google drive then download is straightforward, or for that matter any suitable online server location.

I don't save excel or word files, both I created directly using the javascript plugin:

  1. JSON TO EXCEL
  2. HTML TO WORD

Then consider saving them to files on google drive first, then download those files.

this is my command to create doc file:

var HtmlHead = "SIAP ~ abu musa computer";
var EndHtml = "";
var html = HtmlHead +document.getElementById("tabel").innerHTML+EndHtml;

      var blob = new Blob(['\ufeff', html], {
          type: 'application/msword'
      });
      var url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
      filename = filename?filename+'.doc':'document.doc';
      var downloadLink = document.createElement("a");
      document.body.appendChild(downloadLink);
      if(navigator.msSaveOrOpenBlob ){
          navigator.msSaveOrOpenBlob(blob, filename);
      }else{
          downloadLink.href = url;
          downloadLink.download = filename;
          downloadLink.click();
      }          
    }

and this is for creating xls files:

      var myWorkSheet = XLSX.utils.json_to_sheet(myjson);
      var myWorkBook = XLSX.utils.book_new();
      XLSX.utils.book_append_sheet(myWorkBook, myWorkSheet, "myWorkSheet");
      XLSX.writeFile(myWorkBook, 'unduh.xls');

maybe can you make a downloadable doc or xls file that can run on a desktop browser or on an android webview? directly downloaded without having to save the file on the internet

This is just a theory and might not work as imagined.


Whenever there is a prompt to download blob file, you'll get this blob data as url parameter in OnDownloadNeeded event.
If we observe closely, we find that it is the actual content of file, just url encoded.
Now, you just have to url decode it and then split at comma. Get second element from the list and that's the file content.

Result:

<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head><meta charset='utf-8'><title>SIAP ~ abu musa computer</title></head><body><p style="text-align: center;"><strong%3REGISTER BOOK YELLOW WHICH TEACHED<br>
              AND TO REFERRAL SCIENCE<br>
              PONDOK BOARDINGSCHOOL CONTOH<br>
              YEARS STUDY 2022/2023</strong></p> <table border="1" style="border-collapse: collapse;"><tbody><tr><td style="width: 45px; text-

@vknow360 , what does cache 0,-1 etc mean?

1 Like

this is the part of the code that i used to download the file, said the blob was resolved, but still unable to download the file

this my project file:
SIAP_DEMO_VUETIFY.aia (103.4 KB)

please help solve my problem, for the account from login it when run:
username : demo
password : demo

Read my last post again.
And there is no need to download file after getting content out of the url.

1 Like

can someone help me on uploading multiple data using php.

It is possible.
I'll get back to you tomorrow.

can u give me a tips ?
i just need it now :frowning:

1 Like

It'll need some changes in the source.
I have added them but there's still something left to deal with.
Have patience.

ok thanks