Download blob from IE8?

0

I am trying to save a Zip file with IE8 but it is not possible for me since I am using the JSZip.js library in conjunction with the FileSaver.js, but the FilesSaver.js library gives me an error "The object does not accept the property or the method 'createElementNS' ". This is according to why it does not allow saving a blob file.

This is what I'm using and in chrome it works perfect for me.

var Promise = window.Promise;
if (!Promise) {
    Promise = JSZip.external.Promise;
}

function urlToPromise(url) {
    return new Promise(function(resolve, reject) {
        JSZipUtils.getBinaryContent(url, function (err, data) {
             if(err) {
               reject(err);
           } else {
                resolve(data);
            }
        });
    });
}

  function CreaZip(){

     var zip = new JSZip();


         var url = "/xxxxx/DownloadFile.do?TIP_Documento=xxxx&TIP_Archivo=xxxxx&COD_Tribunal=xxxxx&CRR_IdDocumento=xxxx&CRR_IdTramite=xxxx"; 
         /* var filename = url.replace(/.*\//g, ""); */
         var filename = "test.pdf";
         zip.file(filename, urlToPromise(url), {binary:true});


 zip.generateAsync({type:"blob"})
 .then(function callback(blob) {

     // see FileSaver.js
     saveAs(blob, "example.zip");
 });
 return false;

 }

Does anyone know of any method that allows saving a blob file in IE8 ?, that the only thing I have seen is the download of txt or html.

I hope you can help me.

Thank you very much !!!

    
asked by user3674768 20.08.2018 в 17:03
source

0 answers