Archived Forum Post

Index of archived forum posts

Question:

SFTP activex does not upload to directory specified

Aug 26 '16 at 14:39

Given a directory structure of: / -- certificates -- incoming -- outgoing

I am attempting to uplaod to the "certificates" directory, but no moatter how I specify it, it goings always to "incoming". Is there a way to control the target directory?

My Foxpro code: lnSuccess = this.sftp(this.cLocalSFTPServer,,"INTEK",this.cINTEKSFTPPassword,"/certificates",lower(addbs(justpath(tcCertFile))),,,"UPLOAD",lower(justfname(tcCertFile)))


Answer

That is an abstraction to use the Chilkat tool.

And it looks like you are passing in an absolute path. If you are wanting to put it in a directory under incoming, you may need to pass in "./certificates" or just "certificates"

http://cknotes.com/understanding-sftp-absolute-filepaths/

HTH, Tracy


Answer

Thanks, Tracy. I am trying to pass it to the directory under root: "/certificates" and it goes to "incoming", the user home directory

I also tried "certificates","../certificates"


Answer

Here's a couple of things you may need to verify:

To better help, I'll need to see the abstraction of Chilkat.


Answer

Windows or Unix Server?

Try the absolute path name /home/user/certificates There is a method to get the absolute path.

The implementation of this is horrible.

If you have virtual folders or mounted/mapped drives (server side) it acts different.

I wish there was one ftp module, and you pass the protocol. and for sftp, you use the cd method, and the lib figures it out.


Answer

Another option would be to have the server side put you in the correct folder when you login, and just upload the file.