From 60df1c2cf8dc092615e5f0ae34c2c2951644580b Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 30 Jun 2026 13:36:15 +0200 Subject: [PATCH] fix(upload): only create directory if needed When doing a batch upload / file tree upload, we should not try to create the root folder which is the empty string. Signed-off-by: Ferdinand Thiessen --- lib/upload/uploader/UploadFileTree.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/upload/uploader/UploadFileTree.ts b/lib/upload/uploader/UploadFileTree.ts index 1e7651ed0..48d8be39a 100644 --- a/lib/upload/uploader/UploadFileTree.ts +++ b/lib/upload/uploader/UploadFileTree.ts @@ -134,7 +134,10 @@ export class UploadFileTree extends Upload implements IUpload { this.uploadedBytes = 0 this.status = UploadStatus.UPLOADING - await this.#createDirectory(queue) + // if this is not the root of a tree, we need to create the directory first before uploading the children + if (this.#directory.webkitRelativePath) { + await this.#createDirectory(queue) + } if (this.needConflictResolution && this.#conflictsCallback) { const nodes = await this.#conflictsCallback( this.#directory.children.map((node) => basename(node.name)),