Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in path when uploading #75

Open
zaghop opened this issue May 13, 2019 · 3 comments
Open

Error in path when uploading #75

zaghop opened this issue May 13, 2019 · 3 comments

Comments

@zaghop
Copy link

zaghop commented May 13, 2019

I am attempting to transfer a file using SFTP on a windows machine. When the package attempts to send the file, it is using an incorrect path. I am passing in the full path location, but it is appending the following to the beginning of the path.

"/cygdrive/c/Scripts/file-mover/"

The script is located in C:/Scripts/file-mover. For example, if I pass in a filename of "C:/Temp/thisfile.txt" the error that I see is as follows:

{ error:
'put: /cygdrive/c/Scripts/file-mover/C:/Temp/thisfile.txt: No such file or directory\n',
data: '' }

Is there a way to prevent this?

@psuresh246
Copy link

Hi, Any update on this issue?

@tirilo555
Copy link

I have the same problem

@Akshatha1700
Copy link

ftps is used in unix environments, so its expecting the path to be in /cygdrive/c

Converting the windows path to unix path should be able to fix this issue.

const convertPathToUnix = (windowsPath) => {
return windowsPath.replace(/\/g, '/').replace(/^([a-zA-Z]):/, '/cygdrive/$1');
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants