feat(drive): download folder as archive - #11005
Open
AitiX wants to merge 1 commit into
Open
Conversation
AitiX
force-pushed
the
feature/drive-folder-download-archive
branch
from
August 12, 2026 12:36
f6d47f6 to
5054d15
Compare
Add a 'Download as archive' action for Drive folders. The action walks the folder tree, fetches every file blob and packs them into a single zip on the client (fflate, store mode), preserving the relative folder structure. Localized for en and ru. Signed-off-by: Alexander Ilyenko <alexander_ilyenko@outlook.com>
AitiX
force-pushed
the
feature/drive-folder-download-archive
branch
from
August 12, 2026 12:39
5054d15 to
90ebb78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a Download as archive action for folders in the Drive module. Previously only
individual files could be downloaded; folders with many files (e.g. build artifacts)
had to be fetched one file at a time.
The action walks the folder tree through the platform client, fetches every file blob
and packs everything into a single
<folder name>.zipon the client, preserving therelative folder structure inside the archive.
Implementation notes
drive.action.DownloadFolder/drive.actionImpl.DownloadFolder,registered for
drive.class.Foldernext to the existing fileDownloadaction(same category,
toolsgroup, context + browser modes).plugins/drive-resources/src/archive.ts): recursiveclient.findAlloverdrive.class.File(with$lookupof the currentFileVersion) anddrive.class.Folder, sorted by title for deterministicarchives. A visited-set guards against cycles, and duplicate titles within one
folder get a numeric suffix.
getFileUrlfrom@hcengineering/presentation(the sameURL the file
Downloadaction uses) and plainfetch, matching howgetJsonOrEmptyfetches blobs elsewhere in the platform.fflate(^0.8.2), addedto
@hcengineering/drive-resources. No workspace package currently depends on azip library directly (
jszipappears in the lockfile only as a transitivedependency of docx tooling), so the smallest streaming option was chosen.
Entries are added via
ZipPassThrough(store, no re-compression): Drive blobs aretypically already compressed or incompressible (archives, media, build artifacts),
so this keeps CPU usage minimal while still producing a standard zip.
temporary object URL. Empty folders produce no download. Errors are reported through
setPlatformStatus(unknownError(...)), consistent with other drive-resources utils.DownloadAsArchivestring (en: "Download as archive",ru: "Скачать архивом"). Other locales fall back to English, matching existing
partially-translated keys in
drive-assets.Changed files
models/drive/src/index.ts— register the folder actionmodels/drive/src/plugin.ts—action.DownloadFolder,actionImpl.DownloadFolderidsplugins/drive-resources/src/archive.ts— new: traversal + zip + saveplugins/drive-resources/src/index.ts—DownloadFolderaction implementationplugins/drive-resources/src/plugin.ts—DownloadAsArchivestring idplugins/drive-resources/package.json— addfflateplugins/drive-assets/lang/en.json,plugins/drive-assets/lang/ru.json— new stringcommon/config/rush/pnpm-lock.yaml— lockfile update forfflateHow to test
with files (mixed types; ideally also two files with the same name in one folder).
...menu) → Download as archive.<folder name>.zipdownload should start; after extraction the content mustmirror the Drive folder structure, including nested subfolders.
/or\still produces a valid archive name.still work.
Checklist
rush build --to @hcengineering/model-drive --to @hcengineering/drive-resources)