generate downloadable files in the browser using Blob and URL API
Channel: SpinSpire
Date: 2020-06-29

Shows how to create CSV, TXT, PDF, ICS/iCal, etc files right within the browser without ever hitting server-side. Uses the Blob API to build files in the browser and the URL API to create object URLs from them to make them downloadable. The whole thing is as simple as ...

    const a = document.getElementById("a1");
    const blob = new Blob(["your data"]);
    a.href = URL.createObjectURL(blob);

For questions, post a comment. For business inquiries, email info@spinspire.com.