mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
✨ Make it possible to sent fileExtension on Salesforce Document
upload
This commit is contained in:
@@ -85,6 +85,14 @@ export const documentFields = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
displayName: 'File Extension',
|
||||||
|
name: 'fileExtension',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
placeholder: 'pdf',
|
||||||
|
description: 'File extension to use. If none is set, the value from the binary data will be used.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Link To Object ID',
|
displayName: 'Link To Object ID',
|
||||||
name: 'linkToObjectId',
|
name: 'linkToObjectId',
|
||||||
|
|||||||
@@ -1687,7 +1687,7 @@ export class Salesforce implements INodeType {
|
|||||||
const binaryData = items[i].binary![binaryPropertyName];
|
const binaryData = items[i].binary![binaryPropertyName];
|
||||||
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
||||||
|
|
||||||
body.entity_content['PathOnClient'] = `${title}.${binaryData.fileExtension}`;
|
body.entity_content['PathOnClient'] = `${title}.${additionalFields.fileExtension || binaryData.fileExtension}`;
|
||||||
data = {
|
data = {
|
||||||
entity_content: {
|
entity_content: {
|
||||||
value: JSON.stringify(body.entity_content),
|
value: JSON.stringify(body.entity_content),
|
||||||
@@ -1698,11 +1698,11 @@ export class Salesforce implements INodeType {
|
|||||||
VersionData: {
|
VersionData: {
|
||||||
value: dataBuffer,
|
value: dataBuffer,
|
||||||
options: {
|
options: {
|
||||||
filename: binaryData.fileName,
|
filename: body.entity_content['PathOnClient'],
|
||||||
contentType: binaryData.mimeType,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new NodeOperationError(this.getNode(), `The property ${binaryPropertyName} does not exist`);
|
throw new NodeOperationError(this.getNode(), `The property ${binaryPropertyName} does not exist`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user