goph icon indicating copy to clipboard operation
goph copied to clipboard

panic: sftp: "Failure" (SSH_FX_FAILURE)

Open aiyijing opened this issue 3 years ago β€’ 3 comments

Here is my code:

	err = client.Upload("./test.txt", "/root/")
	if err != nil {
		panic(err)
	}

it will raise error(sftp: "Failure" (SSH_FX_FAILURE)) when remotePath is not full path. It is necessary to adapt the path without a file name

aiyijing avatar May 04 '21 12:05 aiyijing

Hi, It should be like:

err = client.Upload("./test.txt", "/root/test.txt")

melbahja avatar May 04 '21 16:05 melbahja

I'm sorry,I know how to do it. this is my suggestion: it should support transferring files when the path is incomplete. It's like: πŸ˜„

scp ./test.txt root@exampleHost:/root/

aiyijing avatar May 04 '21 17:05 aiyijing

why not in v2 :smile:

melbahja avatar May 05 '21 18:05 melbahja