n8n-nodes-sftp-custom 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/Sftp/Sftp.node.js +16 -8
- package/package.json +1 -1
|
@@ -135,17 +135,25 @@ class Sftp {
|
|
|
135
135
|
conn.end();
|
|
136
136
|
return reject(err);
|
|
137
137
|
}
|
|
138
|
-
const writeStream = sftp.createWriteStream(remotePath + binaryData.fileName);
|
|
139
|
-
writeStream.on('close', () => {
|
|
138
|
+
// const writeStream = sftp.createWriteStream(remotePath + binaryData.fileName);
|
|
139
|
+
// writeStream.on('close', () => {
|
|
140
|
+
// conn.end();
|
|
141
|
+
// resolve(true);
|
|
142
|
+
// });
|
|
143
|
+
// writeStream.on('error', (err: Error) => {
|
|
144
|
+
// conn.end();
|
|
145
|
+
// reject(err);
|
|
146
|
+
// });
|
|
147
|
+
// writeStream.write(fileBuffer);
|
|
148
|
+
// writeStream.end();
|
|
149
|
+
const fullPath = remotePath + binaryData.fileName;
|
|
150
|
+
sftp.writeFile(fullPath, fileBuffer, (err) => {
|
|
140
151
|
conn.end();
|
|
152
|
+
if (err) {
|
|
153
|
+
return reject(err);
|
|
154
|
+
}
|
|
141
155
|
resolve(true);
|
|
142
156
|
});
|
|
143
|
-
writeStream.on('error', (err) => {
|
|
144
|
-
conn.end();
|
|
145
|
-
reject(err);
|
|
146
|
-
});
|
|
147
|
-
writeStream.write(fileBuffer);
|
|
148
|
-
writeStream.end();
|
|
149
157
|
});
|
|
150
158
|
});
|
|
151
159
|
conn.on('error', (err) => {
|