Перейти к содержимому

generate downloadable files in the browser using Blob and URL API

SpinSpire

0:00 / 0:00

generate downloadable files in the browser using Blob and URL API

68 974 просмотра · 6 лет назад
SpinSpire
1,3 тыс. подписчиков
68 974 просмотра · 6 лет назад
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.