Closed ScottRandallWay closed 2 years ago
Additionally we figured out this code seems to work fine on windows (our dev workstations), but is failing on Centos 7 which is our dev and test servers.
Additionally we figured out this code seems to work fine on windows (our dev workstations), but is failing on Centos 7 which is our dev and test servers.
use node version <= 17.8.0
@ScottRandallWay Actually you are doing little bit wrong. We can access WriteStream in below manner, if using promise (thenable)
sftp.createWriteStream(targetFile).then((writeStream) => {
writeStream.write(dataContent, {mode: 0o777});
});
I will update readme around it.
For example: https://github.com/sanketbajoria/ssh2-promise/blob/master/spec/sftp-spec.js#L73
We had existing code that used ssh2 to write a string to a file and it worked for several years. We upgraded to ssh2-promise now it seems we are not getting a valid writestream. We just keep getting writestream.write is not a function. Are we doing something wrong?