Closed Anahid closed 8 years ago
Try to use path
to find you file on Windows.
Thank you so much for your response! can you please explain more?
I have the directory on my windows node server machine. the file test.txt does exist on my linux remote server as well. Not sure what is wrong.
Maybe you can write like 'H:\\dataDirOnNodeServer'
Thanks for your reply! tried this, it didn't work, sorry i forgot to mention what I have tried already, I have tried ./ , ./H:/dataDirOnNodeServer and ./H:/dataDirOnNodeServer/ also /H:/dataDirOnNodeServer, also tried uploading to the linux machine from windows node server, it works fine, it's only the download from linux to windows node server that does not work.
I solved this! The issue was that I was calling this client within a success of another client, therefore the file was using the same instance to perform the copy. To fix this I changed the scp library code loacted in scp2/lib/scp.js as follows:
-var client = require('./client'); +var Client = require('./client').Client; +var client = new Client();
(First line was removed and the two lines below were added), this way every time a new instance is called. This also solved an issue of stack overflow I was getting prior this.
Hi,
I am trying to download a file from a remote linux server (from directory /home/dataFiles/test.txt) into node server (to directory H:/dataDirOnNodeServer). In order to do so I run the following:
client.scp('linuxUsername:linuxPassword@linuxserverName:/home/dataFiles/test.txt', 'H:/dataDirOnNodeServer', function(err) { console.log(err); })
I get an error: Error: Underlying stream not writable
I would really appreciate it if you can help me with this.
Many Thanks.
Ana