mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
✨ Make it possible to sent fileExtension on Salesforce Document
upload
This commit is contained in:
parent
674313e0c4
commit
5de93a7db1
|
@ -85,6 +85,14 @@ export const documentFields = [
|
|||
},
|
||||
},
|
||||
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',
|
||||
name: 'linkToObjectId',
|
||||
|
|
|
@ -1687,7 +1687,7 @@ export class Salesforce implements INodeType {
|
|||
const binaryData = items[i].binary![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 = {
|
||||
entity_content: {
|
||||
value: JSON.stringify(body.entity_content),
|
||||
|
@ -1698,11 +1698,11 @@ export class Salesforce implements INodeType {
|
|||
VersionData: {
|
||||
value: dataBuffer,
|
||||
options: {
|
||||
filename: binaryData.fileName,
|
||||
contentType: binaryData.mimeType,
|
||||
filename: body.entity_content['PathOnClient'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The property ${binaryPropertyName} does not exist`);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue