Hi,
is there a proper or good way to save exported content on the computer? I have seen there is the exportAsync function, but that only packages the content into a variable without starting a download.
I found one method in the export zip plugin, but it feels unnecessarily complex and a bit hacky as well by starting a download via a html element. Also, the createObjectURL()
seem to make trouble, when I tried it on a quick run.
That’s the method used by the export zip plugin:
zip.generateAsync({ type: 'blob' })
.then((content: Blob) => {
const blobURL = window.URL.createObjectURL(content);
const link = document.createElement('a');
link.className = 'button button--primary';
link.href = blobURL;
link.download = "export.zip"
link.click()
link.setAttribute('download', name + '.zip');
resolve();
});
Thank you all for helping. 🙂