login about faq

I am using a 30 day trial to test the SFTP Library. I can upload a local file to a SFTP site but it always is written to the root "." Directory. I have tried to use absPath = sftp.RealPath(".", "/dest")

But file is still uploaded to the "." Directory.

How do I change the directory?

asked Jun 21 '12 at 16:48

chilkat's gravatar image

chilkat ♦♦
3.4k110170241


You don't "change directories". If you are calling the UploadFileByName method, then the remoteFilePath argument would be something like "./subdir1/subdir2/myFile.dat" and the localFilePath would be the path (relative or absolute) of the file in the local filesystem.

For any method having a remote path argument, you would specify either the path relative to the HOME directory of the SSH user account, or the absolute path from the root of the remote filesystem. I would always recommend using the relative path from the HOME directory.

link

answered Jul 09 '12 at 22:58

chilkat's gravatar image

chilkat ♦♦
3.4k110170241

edited Jul 09 '12 at 22:59

Matt You have explained the differences really well. But now explain how a developer using the SSH ActiveX component will be able to logon on to the server, change directories to somewhere on the server and THEN upload a file. From your explanation above, it is unclear whether you are suggesting a developer would need to use both the SSH Dll (to connect) and once connected, the FTP2 DLL to upload. Is this how it works? Why can't you provide one complete END 2 END example?

link

answered Jul 09 '12 at 22:26

Fonz's gravatar image

Fonz
1

SFTP is Secure File Transfer over SSH. It is not the FTP protocol. There is no similarity or relationship between FTP and SFTP. Therefore, concepts such as “current remote directory” that exist in FTP do not exist with SFTP. With the SFTP protocol, the current directory will always be the home directory of the user account used during SSH/SFTP authentication. You may pass relative or absolute directory/file paths. A relative path is always relative to the home directory of the SSH user account. See this blog post for more details about absolute paths: SFTP Absolute Directory Paths

Further clarification: “SFTP” is the Secure File Transfer Protocol over SSH. It is a protocol unrelated to the FTP protocol. The Chilkat SSH / SFTP component is used for “SFTP”. SFTP is achieved by connecting to an SSH server at port 22.

On the other hand, the Chilkat FTP2 components is for FTP. FTP servers listen at port 21 (non-SSL/TLS) and port 990 (SSL). FTP over SSL (i.e. port 990) is called “FTPS”. (not SFTP)

link

answered Jun 21 '12 at 16:50

chilkat's gravatar image

chilkat ♦♦
3.4k110170241

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×66

Asked: Jun 21 '12 at 16:48

Seen: 821 times

Last updated: Jul 09 '12 at 22:59

powered by OSQA