pirumpi / sftp-upload

Allow to upload the content of a folder to a remote server through SFT utilizing pure Javascript.
40 stars 21 forks source link

Uploading to home directory not root #6

Closed grimurd closed 7 years ago

grimurd commented 9 years ago

I'm trying to upload to a folder on my server.

The options object looks like this:

    var options = {
            host: 'server.local',
            username: 'user',
            path: './folder',
            remoteDir: '/var/db/www/server.local/htdocs/',
            privateKey: fs.readFileSync('./ssh')
        },

However when i upload it goes into my users folder instead of the root folder. So the path looks like this:

/home/user/var/db/www/server.local/htdocs

I've checked and the user has the write permission to the remote folder.

Is there something i'm doing wrong?

bhanuc commented 9 years ago

Facing the same issue. Did you find any solution to this issue

bhanuc commented 9 years ago

I directly used the scp2 module and its working great as of now .

toni89 commented 8 years ago

It's in this line in the function "SftpUpload.prototype.uploadFiles".\ Please remove the dot in front of remoteFile. client.upload(file, '.'+remoteFile, function(err){

rpolonsky commented 8 years ago

Please, update your package on NPMJS! It still has that bug!

broerse commented 7 years ago

Please run npm publish or give me npm publish rights.

pirumpi commented 7 years ago

npm is now updated