Topic "Adding single file to recursive folder"

Author Message
savvase
[View user's profile]

Joined: 2014-02-26
Posts: 1
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;
Code:
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/)
Code:
"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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License