Download folder/workspace as Zip

Hi all,

Currently, in theia, the user is able to download a workspace or folder as a .tar file.
I would like to change it to download a .zip file.
I’m overriding FileDownloadService and the method forceDownload()
Can anyone guide me how this can be accomplished? any code snippet/examples for changing blob type is much appreciated.

Thanks !

You have to do the customization on the backend and not in the browser. Try DirectoryArchiver#archive instead.

Thank you, @kittaakos.

Shall customize DirectoryArchiver to handle .zip format.
I’m wondering if I can use the npm package zip-dir for compressing a folder. I believe that it was used in the older theia versions (around v0.8.0), but not found in the latest theia versions.
Hope it is okay to use zip-dir ?

Please advise.