Proper way to save exports on the computer


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.setAttribute('download', name + '.zip');

Thank you all for helping. :slight_smile:

This is a fairly standard way to download files using JavaScript. And as a more advanced method, you can use the FileSaver.js library.

1 Like

Thanks for your answer. Seems to be a good way then.
I think I was hoping for a helper function from the Figma API to access local files as we had it with Sketch’s skpm/fs. Too bad. :smiley: