4 ms·
I actually implemented it recently in one of my open-source apps. It's 6 lines of Javascript: Create an <a> element, set the data in its href with: element.set
by eshnil 4y ago
I actually implemented it recently in one of my open-source apps. It's 6 lines of Javascript: Create an <a> element, set the data in its href with:
element.setAttribute("href","data:text/plain;charset=utf-8," +encodeURIComponent(content))
and element.click() followed by document.body.removeChild(element);
This works perfectly fine for saving single files. FileSystem access API is useful when entire directory needs to be stored and perhaps without the standard SaveAs.. UI.
- c-hendricks 4y agoThose users probably didn't need their RAM anyways