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: [
|
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`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue