angularjs - Make blob download work in FireFox and IE10/11 -


i have following code in angularjs supposed receive array of bytes web api method , download file.

this code working in latest google, when try in latest firefox code executes without errors, no download occurs. in ie 11, download not happen.

question: how can make blob code work in latest firefox , ie 10/11?

          return mydataservice.getbytearray()                 .then(function (data) {                  var bytearray = new uint8array(data);                 var element = angular.element('<a/>');                 element[0].href = window.url.createobjecturl(new blob([bytearray],                     { type: 'application/octet-stream' }));                  element[0].download = 'mydatareport.pdf';                  element[0].click();            }); 

update 1:

in ie 10/11, code executes without errors till element[0].click() called, when following error happens.

enter image description here


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -