5

I have an issue with saving an excel file in Ipad + Safari.Please note, my only issue is with Ipad/Iphone IOS + Safari.
Library I'm using to implement the 'save as' functionality is FileSaver.js, but it does have this bug for Safari.

Solutions I tried so far :

  • using HTML5 download attribute, but download attr is not supported in IOS Safari

var blob = new Blob([jx_s2ab(wbout)], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8'});
var a = window.document.createElement("a"); 
a.href = window.URL.createObjectURL(blob);
a.download = "textexcel.xlsx"; 
a.target = "_blank"
document.body.appendChild(a);
a.click();  
document.body.removeChild(a);
  • File Reader API

var blob = new Blob([jx_s2ab(wbout)], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8'});
var reader = new FileReader();
     reader.onload = function(e){
        window.location.href = reader.result;
                
     }
     reader.readAsDataURL(blob);

Out of all the above solutions, best one so far: File Reader API. It is actually working and I'm able to open the file with correct data.But the only issue is with the file name and no option to open in new tab. In Ipad+Safari, the file name is showing as 'unknown.xlsx', Which is not a good user experience.

Please share if any fix is available for file name issue or any other library is available.

ajeshrkurup
  • 165
  • 3
  • 14
  • Did you get any solution for this , i am facing the same for zip file download in ipad safari browser – a4DEVP Apr 03 '19 at 11:43
  • No solution yet. Actually I'm no longer concerned about this, as we moved to server side. Did you check the file reader API option, may be IOS Safari might have better support now. – ajeshrkurup Apr 04 '19 at 17:33
  • Still issue happneing, No option to give file for the downloaded file. – Palani Kumar Jun 12 '23 at 10:51

0 Answers0