29
rated 0 times
[
33]
[
4]
/ answers: 1 / hits: 171034
/ 9 Years ago, wed, january 27, 2016, 12:00:00
I want to download the file which is coming in the form of bytes from the AJAX response.
I tried to do it this way with the help of Blob
:
var blob=new Blob([resultByte], {type: "application/pdf"});
var link=document.createElement('a');
link.href=window.URL.createObjectURL(blob);
link.download="myFileName.pdf";
link.click();
It is in fact downloading the pdf file but the file itself is corrupted.
How can I accomplish this?
More From » post