Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: SftpPathNotFound - Creating directory then uploading file

$
0
0
I have the following issue where I create directory to the client I want to upload files (windows host/linux guest) then proceed to upload the file and it returns a SftPathNotFoundException. Only if I catch the exception and retry the file upload will it pass.

Assume the following path exists on the guest machine /home/abc/xyz, my code
string path = "/home/abc/xyz/child"

if(!client.Exist(path))
  client.CreateDirectory(path)

//proceed to upload file to newly created path
client.UploadFile(some_file_stream,path + "'\\" + some_file_name)
This will result in SftPathNotFoundException unless I catch it and retry the above.

Viewing all articles
Browse latest Browse all 1729

Trending Articles