skip to Main Content

I’ve studied all of the SO Similar Questions about this problem, a few were helpful, but did not directly address the saving of an xlsx file to the local Win10 downloads folder.

The xlsx file sits on a CentOS 7 server. If I use Filezilla to copy it to Win10, it’s fine.

Looking at the component code below, I am reading the xlsx from the server and getting its base64Str, which matches exactly what I used to store the file. I create a blob fine, but FileSaver, saves the Win10 file with its contents as the base64Str, instead of a an xlsx binary. Can FileSaver save binary content, or only text?

Thanks for helping!

Component Code

//INPUT DATA: docName: test.xlsx; mediaType: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; snippet base64Str: VUVzREJCUU...FBQUFBPQ=
//NOTE: input data is from a CentOS 7 filesystem 

const byteStr = atob(base64Str);
const arrayBuffer = new ArrayBuffer(byteStr.length);
const int8Array = new Uint8Array(arrayBuffer);
for (let i = 0; i < byteStr.length; i++) {
  int8Array[i] = byteStr.charCodeAt(i);
}
const blob = new Blob([arrayBuffer], { type: mediaType }); //also tried type: 'application/octet-stream'   

//alternate technique that produces same corrupted result  
//const base64Response = await fetch(`data:` +mediaType +`;base64,${base64Str}`);
//const blob = await base64Response.blob();

fileSaver.saveAs(blob, docName);  //saves to Win10 downloads folder

3

Answers


  1. Not sure if this works , but try setting the mediaType like below :

    const mediaType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
    
    Login or Signup to reply.
  2. Please try The below code. (Here in this example I have demonstrate the following 1) Input base64 string to a input text area 2) on click of download file link 3) will prompt to download the file into correct xlsx format without corrupted data).

    Kindly modify the code as per your need . Example only demonstrate the file download feature.

    Point to notice :

    var mediaType="data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,";
    
     function saveAsXlsxFile(){
          var mediaType="data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,";
          var userInp = document.getElementById('base64input');
         // var userInp = "UEsDBBQABgAIAAAAIQBBN4LPbgEAAAQFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAA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R5cGVzXS54bWxQSwECLQAUAAYACAAAACEAtVUwI/QAAABMAgAACwAAAAAAAAAAAAAAAACnAwAAX3JlbHMvLnJlbHNQSwECLQAUAAYACAAAACEARbo8GF0DAABaCAAADwAAAAAAAAAAAAAAAADMBgAAeGwvd29ya2Jvb2sueG1sUEsBAi0AFAAGAAgAAAAhAIE+lJfzAAAAugIAABoAAAAAAAAAAAAAAAAAVgoAAHhsL19yZWxzL3dvcmtib29rLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhAAdhSeKLAgAARAYAABgAAAAAAAAAAAAAAAAAiQwAAHhsL3dvcmtzaGVldHMvc2hlZXQxLnhtbFBLAQItABQABgAIAAAAIQDBFxC+TgcAAMYgAAATAAAAAAAAAAAAAAAAAEoPAAB4bC90aGVtZS90aGVtZTEueG1sUEsBAi0AFAAGAAgAAAAhACBSf139AgAAwgcAAA0AAAAAAAAAAAAAAAAAyRYAAHhsL3N0eWxlcy54bWxQSwECLQAUAAYACAAAACEAw//qhdEAAACPAQAAFAAAAAAAAAAAAAAAAADxGQAAeGwvc2hhcmVkU3RyaW5ncy54bWxQSwECLQAUAAYACAAAACEAO20yS8EAAABCAQAAIwAAAAAAAAAAAAAAAAD0GgAAeGwvd29ya3NoZWV0cy9fcmVscy9zaGVldDEueG1sLnJlbHNQSwECLQAUAAYACAAAACEAo9Y9cDYBAADkAgAAJwAAAAAAAAAAAAAAAAD2GwAAeGwvcHJpbnRlclNldHRpbmdzL3ByaW50ZXJTZXR0aW5nczEuYmluUEsBAi0AFAAGAAgAAAAhAFSTEGpDAQAAawIAABEAAAAAAAAAAAAAAAAAcR0AAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhAGFJCRCJAQAAEQMAABAAAAAAAAAAAAAAAAAA6x8AAGRvY1Byb3BzL2FwcC54bWxQSwUGAAAAAAwADAAmAwAAqiIAAAAA";
          var a = document.createElement('a');
          a.href = mediaType+userInp.value;
          //a.href = mediaType+userInp;
          a.download = 'filename.xlsx';
          a.textContent = 'Download file!';
          document.body.appendChild(a);
        }
    <textarea placeholder="paste the base64 data here, exclude readable headers" id='base64input' type="textarea"></textarea>
    <br>
    <input onclick="saveAsXlsxFile()" type="button" value="update content of link"></button>

    HTML code for demo only ( not mandatory for your requirement)

    <textarea placeholder="paste the base64 data here, exclude readable headers" id='base64input'></textarea>
    <br>
    <input onclick="saveAsXlsxFile()" type="button" value="update content of link"></button>
    
    
    Sample userInp value Try this : 
    

    UEsDBBQABgAIAAAAIQBBN4LPbgEAAAQFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsVMluwjAQvVfqP0S+Vomhh6qqCB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EAo9Y9cDYBAADkAgAAJwAAAAAAAAAAAAAAAAD2GwAAeGwvcHJpbnRlclNldHRpbmdzL3ByaW50ZXJTZXR0aW5nczEuYmluUEsBAi0AFAAGAAgAAAAhAFSTEGpDAQAAawIAABEAAAAAAAAAAAAAAAAAcR0AAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhAGFJCRCJAQAAEQMAABAAAAAAAAAAAAAAAAAA6x8AAGRvY1Byb3BzL2FwcC54bWxQSwUGAAAAAAwADAAmAwAAqiIAAAAA

    Sample Image screen

    Happy to help further if needed. 🙂

    Login or Signup to reply.
  3. so I used this. Might also work for anyone trying to convert a static base 64 string to xlxs file. This solutions assumes that you know the file type.

    let toConvert = 'UEsDBBQAAAgIABSJA..'//supply your full plain string here
    let  file = `data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,${toConvert}`;
    setTimeout(() => {
      fileSaver.saveAs(file, 'fileName');
    }, 1300);//timeout is only added to simulate time to load. you can take it out
    

    Regards

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search