mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(AWS Textract Node): Handle all binary data modes correctly (#19258)
Co-authored-by: jeanpaul <jeanpaul@users.noreply.github.com> Co-authored-by: Roman Davydchuk <roman.davydchuk@n8n.io>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
BINARY_ENCODING,
|
||||
NodeConnectionTypes,
|
||||
type ICredentialDataDecryptedObject,
|
||||
type ICredentialsDecrypted,
|
||||
@@ -117,11 +118,13 @@ export class AwsTextract implements INodeType {
|
||||
if (operation === 'analyzeExpense') {
|
||||
const simple = this.getNodeParameter('simple', i) as boolean;
|
||||
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
||||
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
||||
const binaryBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
||||
// Convert the binary buffer to a base64 string
|
||||
const binaryData = Buffer.from(binaryBuffer).toString(BINARY_ENCODING);
|
||||
|
||||
const body: IDataObject = {
|
||||
Document: {
|
||||
Bytes: binaryData.data,
|
||||
Bytes: binaryData,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user