Why am I getting this error in IE: “The data area passed to a system call is too small”?

前端 未结 2 689
慢半拍i
慢半拍i 2021-02-12 23:57

I\'m creating a csv file for download using Javascript and it\'s working perfectly fine in everything except for IE (I\'ve tested 8 and 10).

In IE8, when I click the b

相关标签:
2条回答
  • 2021-02-13 00:26

    This is a known issue, but there is a workaround.

    Add the following code

    if (navigator.msSaveBlob) 
    { // IE 10+ 
    navigator.msSaveBlob(new Blob([csv], { type: 'text/csv;charset=utf-8;' }), "filename.csv"); 
    }
    

    and the issue should be resolved. This works for IE10, I have not tested it on IE8 (I don't have IE8 anymore!)

    Refer to:

    https://msdn.microsoft.com/library/Hh772331

    https://msdn.microsoft.com/library/Hh772298

    Source

    0 讨论(0)
  • 2021-02-13 00:39

    There is a size restriction of URL in IE.

    0 讨论(0)
提交回复
热议问题