I'm trying to create or truncate a file on the server (original code in FoxPro), but I'm getting the following response. I had changed the disposition to "createTruncate,deleteOnClose" when this started, and I removed deleteOnClose back out, but I am still receiving this message:
SftpVersion: 3Actual code is as follows:
remotePath: (IP address cleared for security)/FTPTEST.TXT
StatusMessage: No such file
lcTargetFile = lcServerName + lcFoldername + "FTPTEST.TXT"My handle at this point is an empty string, and the LastErrorText returns the above. Any hints or help would be greatly appreciated!
lnHandle = oSFTP.OpenFile(lcTargetFile,"readWrite","createTruncate")
The remote file path argument to OpenFile should be a relative path from the HOME directory of the SSH/SFTP user account. You probably don't want the server name in the path, and you probably don't want the path to begin with "/" (which would specify an absolute path on the remote server).
When a customer under support provides me with a login for such a problem, the first thing I do is to get my bearings -- immediately after authenticating, I run a snippet of code that fetches the HOME directory listing and shows the entries (files/sub-directories) that are present. If they don't match what I would expect to see, then...