mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🐛 Fix access right issues with download file via SSH
This commit is contained in:
parent
94ad8cef2f
commit
2daece5f9d
|
@ -309,7 +309,7 @@ export class Ssh implements INodeType {
|
||||||
|
|
||||||
const credentials = this.getCredentials('sshPrivateKey') as IDataObject;
|
const credentials = this.getCredentials('sshPrivateKey') as IDataObject;
|
||||||
|
|
||||||
const { path, } = await file();
|
const { path, } = await file({ prefix: 'n8n-ssh-' });
|
||||||
temporaryFiles.push(path);
|
temporaryFiles.push(path);
|
||||||
await writeFile(path, credentials.privateKey as string);
|
await writeFile(path, credentials.privateKey as string);
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ export class Ssh implements INodeType {
|
||||||
const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i) as string;
|
const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i) as string;
|
||||||
const parameterPath = this.getNodeParameter('path', i) as string;
|
const parameterPath = this.getNodeParameter('path', i) as string;
|
||||||
|
|
||||||
const { path } = await file({ mode: 0x0777, prefix: 'prefix-' });
|
const { path } = await file({ prefix: 'n8n-ssh-' });
|
||||||
temporaryFiles.push(path);
|
temporaryFiles.push(path);
|
||||||
|
|
||||||
await ssh.getFile(path, parameterPath);
|
await ssh.getFile(path, parameterPath);
|
||||||
|
@ -389,7 +389,7 @@ export class Ssh implements INodeType {
|
||||||
throw new Error(`No binary data property "${propertyNameUpload}" does not exists on item!`);
|
throw new Error(`No binary data property "${propertyNameUpload}" does not exists on item!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { path } = await file();
|
const { path } = await file({ prefix: 'n8n-ssh-' });
|
||||||
temporaryFiles.push(path);
|
temporaryFiles.push(path);
|
||||||
await writeFile(path, Buffer.from(binaryData.data, BINARY_ENCODING));
|
await writeFile(path, Buffer.from(binaryData.data, BINARY_ENCODING));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue