mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ encode file to base64
This commit is contained in:
parent
e0a42fbbd1
commit
ccb445a714
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue