From 84fc2f91e253ee6a9d32309ee789c09c989eeeb1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Tue, 5 Nov 2024 15:58:26 +0000 Subject: [PATCH] Added 550 to handle IIS rename failure --- packages/nodes-base/nodes/Ftp/Ftp.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Ftp/Ftp.node.ts b/packages/nodes-base/nodes/Ftp/Ftp.node.ts index 3382f0feff33c..d9c8a94b42abc 100644 --- a/packages/nodes-base/nodes/Ftp/Ftp.node.ts +++ b/packages/nodes-base/nodes/Ftp/Ftp.node.ts @@ -758,7 +758,7 @@ export class Ftp implements INodeType { try { await ftp!.rename(oldPath, newPath); } catch (error) { - if (error.code === 451 && options.createDirectories) { + if ([451, 550].includes(error.code) && options.createDirectories) { const dirPath = newPath.replace(basename(newPath), ''); await ftp!.mkdir(dirPath, true); await ftp!.rename(oldPath, newPath);