Skip to content

Commit

Permalink
fix: sftp fastGet download - files which size is greater than 64KB ar…
Browse files Browse the repository at this point in the history
…e corrupted (#19)

* fix: files which size is greater than 64KB are corrupted when using sftp fastGet

Related issue: mscdex/ssh2#1166

* Update sftp.js
  • Loading branch information
ryordanov authored Nov 1, 2022
1 parent 83d07ad commit eac46fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = (...params) => class FtpPort extends require('./base')(...param
const localFile = params?.localFile || uuid();
const localFilePath = path.join(this.workDir, localFile);
return new Promise((resolve, reject) =>
sftp.fastGet(params.remoteFile, localFilePath, {}, e => {
sftp.fastGet(params.remoteFile, localFilePath, {...this?.config?.fastGet?.options}, e => {
if (e) return reject(this.errors.ftpPort(e));
if (!params?.localFile) {
const file = fs.readFileSync(localFilePath);
Expand Down

0 comments on commit eac46fb

Please sign in to comment.