CustomWebView : An extended form of Web Viewer

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

Also asking here:

i just finding a solution.

Alright, this works.


Here I replace spaces with empty text.

com.sunny.CustomWebView.aix (199.9 KB)

You can download IntentStarter from here

2 Likes

Show your blocks.

Why did you put FileAccess property under FileUploadedNeeded event?

i just try it but it wont work any of it