Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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.
savvase

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