Archived Forum Post

Index of archived forum posts

Question:

Upload to virtual folder with SFTP?

Oct 15 '15 at 13:05

Have a question though. Is it true that Chilkat cannot upload to a virtual folder? I can SFTP to the root just not the sub-folder.


Answer

The SFTP protocol specification is such that the path to the file to be opened/created/etc. is passed to the server. This may be a relative or absolute path. If relative, it is relative to the HOME directory of the SSH user account. If absolute, it is absolute to the root of the remote filesystem. (It is unlikely the SSH/SFTP server will allow a user account to create/delete/update files anywhere in the filesystem. It is likely to be restricted to only be allowed to access files beneath the HOME directory.)

In the SFTP protocol specification, there is no such thing as being in a "current remote directory" (as there is in FTP). You're effectively always in the HOME directory of the SSH user account.

When you refer to virtual folder -- I don't know what you mean by "virtual". If you mean "virtual" such as an IIS virtual web directory, then that's completely separate from an SSH server. In any case, you pass a path to the SSH server -- relative or absolute, and if the path is somehow interpreted differently than what I've explained above, then it's specific to that particular SSH server's implementation and features.