diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index e7efe06935..ab431fb5cc 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -103,6 +103,7 @@ export async function prepareBinaryData(binaryData: Buffer, filePath?: string, m const filePathParts = path.parse(filePath as string); + returnData.dir = filePathParts.dir; returnData.fileName = filePathParts.base; // Remove the dot diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 8b28ca6b04..43f2a528ae 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -157,6 +157,10 @@
File Name:
{{binaryData.fileName}}
+
+
Directory:
+
{{binaryData.dir}}
+
File Extension:
{{binaryData.fileExtension}}
diff --git a/packages/nodes-base/nodes/ReadBinaryFiles.node.ts b/packages/nodes-base/nodes/ReadBinaryFiles.node.ts index 4e8d9f2ac3..7a42764f35 100644 --- a/packages/nodes-base/nodes/ReadBinaryFiles.node.ts +++ b/packages/nodes-base/nodes/ReadBinaryFiles.node.ts @@ -60,14 +60,12 @@ export class ReadBinaryFiles implements INodeType { const items: INodeExecutionData[] = []; let item: INodeExecutionData; let data: Buffer; - let fileName: string; for (const filePath of files) { data = await fsReadFileAsync(filePath) as Buffer; - fileName = path.parse(filePath).base; item = { binary: { - [dataPropertyName]: await this.helpers.prepareBinaryData(data, fileName), + [dataPropertyName]: await this.helpers.prepareBinaryData(data, filePath), }, json: {}, }; diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index 5e950c3db8..321b701284 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -9,6 +9,7 @@ export interface IBinaryData { data: string; mimeType: string; fileName?: string; + dir?: string; fileExtension?: string; }