Skip to content

Instantly share code, notes, and snippets.

@philipstanislaus
Last active October 6, 2025 06:46
Show Gist options
  • Save philipstanislaus/c7de1f43b52531001412 to your computer and use it in GitHub Desktop.
Save philipstanislaus/c7de1f43b52531001412 to your computer and use it in GitHub Desktop.

Revisions

  1. philipstanislaus renamed this gist Jul 28, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. philipstanislaus created this gist Feb 26, 2016.
    14 changes: 14 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    var saveBlob = (function () {
    var a = document.createElement("a");
    document.body.appendChild(a);
    a.style = "display: none";
    return function (blob, fileName) {
    var url = window.URL.createObjectURL(blob);
    a.href = url;
    a.download = fileName;
    a.click();
    window.URL.revokeObjectURL(url);
    };
    }());

    saveBlob(file, 'test.zip');