From 8d54416f8e6a4cb088c63b2bbed7b9e016afc46c Mon Sep 17 00:00:00 2001 From: Benoit Rospars Date: Fri, 31 Oct 2025 10:59:52 +0100 Subject: [PATCH] Fix web implementation by removing directory creation Removed unnecessary parent directory creation logic before writing the downloaded file. --- packages/capacitor-plugin/src/web.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/capacitor-plugin/src/web.ts b/packages/capacitor-plugin/src/web.ts index 1962d2f..b3a533a 100644 --- a/packages/capacitor-plugin/src/web.ts +++ b/packages/capacitor-plugin/src/web.ts @@ -17,7 +17,6 @@ interface FilesystemPlugin { data: string; recursive?: boolean; }): Promise; - mkdir(options: { path: string; recursive?: boolean }): Promise; } // Extend Window interface to include Capacitor @@ -465,16 +464,6 @@ export class FileTransferWeb extends WebPlugin implements FileTransferPlugin { throw new Error("Failed to convert blob to base64"); } - // Create any parent directories needed - const pathParts = path.split("/"); - if (pathParts.length > 1) { - const directory = pathParts.slice(0, -1).join("/"); - await filesystem.mkdir({ - path: directory, - recursive: true, - }); - } - // Write the file await filesystem.writeFile({ path: path,