From be089331b372e029ab5516b91e63a2d5d9033719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 5 May 2023 12:32:49 +0000 Subject: [PATCH] fix(FTP Node): Use filename instead of remote filepath for downloaded binary data (#6170) --- packages/nodes-base/nodes/Ftp/Ftp.node.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/Ftp/Ftp.node.ts b/packages/nodes-base/nodes/Ftp/Ftp.node.ts index a50b15f538..d71f9b4d19 100644 --- a/packages/nodes-base/nodes/Ftp/Ftp.node.ts +++ b/packages/nodes-base/nodes/Ftp/Ftp.node.ts @@ -601,11 +601,11 @@ export class Ftp implements INodeType { await sftp!.get(path, createWriteStream(binaryFile.path)); const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i); - const filePathDownload = this.getNodeParameter('path', i) as string; + const remoteFilePath = this.getNodeParameter('path', i) as string; items[i].binary![dataPropertyNameDownload] = await this.nodeHelpers.copyBinaryFile( binaryFile.path, - filePathDownload, + basename(remoteFilePath), ); const executionData = this.helpers.constructExecutionMetaData( @@ -697,11 +697,11 @@ export class Ftp implements INodeType { await streamPipeline(stream, createWriteStream(binaryFile.path)); const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i); - const filePathDownload = this.getNodeParameter('path', i) as string; + const remoteFilePath = this.getNodeParameter('path', i) as string; items[i].binary![dataPropertyNameDownload] = await this.nodeHelpers.copyBinaryFile( binaryFile.path, - filePathDownload, + basename(remoteFilePath), ); const executionData = this.helpers.constructExecutionMetaData(