From ccb445a714c7e07a847a1f9ab0fd2e4160e51e96 Mon Sep 17 00:00:00 2001 From: ricardo Date: Fri, 20 Mar 2020 11:18:03 -0400 Subject: [PATCH] :zap: encode file to base64 --- packages/nodes-base/nodes/Webhook.node.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Webhook.node.ts b/packages/nodes-base/nodes/Webhook.node.ts index a05bf1cccc..97f28705bd 100644 --- a/packages/nodes-base/nodes/Webhook.node.ts +++ b/packages/nodes-base/nodes/Webhook.node.ts @@ -328,8 +328,9 @@ export class Webhook implements INodeType { const fileJson = files[file].toJSON() as IDataObject; const [fileName, fileExtension] = (fileJson.name as string).split('.'); const fileContent = await fs.promises.readFile(files[file].path); + const buffer = new Buffer(fileContent); set(returnData[0], `binary[${fileName}]`, { - data: fileContent, + data: buffer.toString('base64'), mimeType: fileJson.type, fileName: fileJson.name, fileExtension,