My application needs to upload files to a SFTP. I can get connected with a private key. On that server there are 3 folders and I need to create a directory in one of them. The folder I need to create a subfolder in is called "Uploads"
If I connect to the server via FileZilla, I can create the folder, so permissions on that side must be ok. If I try to do it with code I get the following error:
What am I doing wrong here?
The success inside the try-catch is false.
The above will try to create a "uploads\1996" sub-directory in the home directory of the logged in user ("Username").
If this SFTP server is Windows based, I guess it should work as Windows uses \ as path separator.
More likely this is a Unix server and \ will have no special meaning. Try to use
success = ftp.CreateDir("uploads/" + sn)instead.
(change \ to /)
and as far as I know Chilkat never throws exceptions so there is no need for the try/catch block.
answered Oct 18 '12 at 07:26