From 97a7701f5d152e9458ab265392715339fa4bfb58 Mon Sep 17 00:00:00 2001 From: Philip Okugbe <16838612+Philipinho@users.noreply.github.com> Date: Mon, 4 Aug 2025 03:20:18 +0100 Subject: [PATCH] fix local storage copy function (#1442) --- apps/server/src/integrations/storage/drivers/local.driver.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/server/src/integrations/storage/drivers/local.driver.ts b/apps/server/src/integrations/storage/drivers/local.driver.ts index 36d9ca9e..caa6ab36 100644 --- a/apps/server/src/integrations/storage/drivers/local.driver.ts +++ b/apps/server/src/integrations/storage/drivers/local.driver.ts @@ -40,8 +40,11 @@ export class LocalDriver implements StorageDriver { async copy(fromFilePath: string, toFilePath: string): Promise { try { + const fromFullPath = this._fullPath(fromFilePath); + const toFullPath = this._fullPath(toFilePath); + if (await this.exists(fromFilePath)) { - await fs.copy(fromFilePath, toFilePath); + await fs.copy(fromFullPath, toFullPath); } } catch (err) { throw new Error(`Failed to copy file: ${(err as Error).message}`);