mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(Extract From File Node): Make binary data work with any backend (#8647)
Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
parent
1e4e126c01
commit
d33d953497
|
@ -160,8 +160,9 @@ export async function extractDataFromPDF(
|
||||||
const params: { password?: string; url?: URL; data?: ArrayBuffer } = { password };
|
const params: { password?: string; url?: URL; data?: ArrayBuffer } = { password };
|
||||||
|
|
||||||
if (binaryData.id) {
|
if (binaryData.id) {
|
||||||
const binaryPath = this.helpers.getBinaryPath(binaryData.id);
|
params.data = await this.helpers.binaryToBuffer(
|
||||||
params.url = new URL(`file://${binaryPath}`);
|
await this.helpers.getBinaryStream(binaryData.id),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
params.data = Buffer.from(binaryData.data, BINARY_ENCODING).buffer;
|
params.data = Buffer.from(binaryData.data, BINARY_ENCODING).buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue