Adding single file to recursive folder

Advertisement

savvase
Joined:
Posts:
1

Adding single file to recursive folder

Hi,
First of all thank you so much for great software and .net assembly.
I'm trying to write a simple application in .net
By using sftp, when I try to upload a whole directory to server (ubuntu server) everthing works perfect.
But trying to;
transferResult = session.PutFiles("C:\test.txt", "/home/myuser/1stfolder/2ndfolder/3rdfolder/test.txt", False, transferOptions)    
code to upload file & create folders which do not exist (/1stfolder/2ndfolder/3rdfolder/)
"Cannot create remote file '/home/myuser/1stfolder/2ndfolder/3rdfolder/test.txt'"
"No such file or directory."
"Error code: 2"
"Error message from server: No such file"    
Is there any auto create method for this or should I check all folders (&create missing folders) before uploading a file?
Thank you for your time and consideration.

Savas

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Adding single file to recursive folder

savvase wrote:

Is there any auto create method for this or should I check all folders (&create missing folders) before uploading a file?
Yes, you have to do this yourself.

Reply with quote

Advertisement

You can post new topics in this forum