Skip to content

FileSaver.js Example

alidbg edited this page Jan 3, 2015 · 5 revisions
  function SaveAsFile(t,f,m) {
        try {
            var b = new Blob([t],{type:m});
            saveAs(b, f);
        } catch (e) {
            window.open("data:"+m+"," + encodeURIComponent(t), '_blank','');
        }
    }
Clone this wiki locally