Method 'UploadFile' of object 'ISDTPConnection' failed

I can connect to the client OK, but when I try to upload a file I get: Method 'UploadFile' of object 'ISDTPConnection' failed
 
The code:
Public objSSH As sfFTPLib.SSHConnection
Call objSSH.Connect
Call objSFTP.UploadFile(FileName, FileName, RestartLow, RestartHi)
 
The log:
2015-03-23T14:01:16 SmartFTP FTP Library 4.0.456.0
2015-03-23T14:01:16 Resolving host name "<ftp site>"
2015-03-23T14:01:16 Connecting to <IP address> Port: 22
2015-03-23T14:01:16 Connected to <ftp site>.
2015-03-23T14:01:16 SSH protocol version reply. Client Id: SSH-2.0-SmartFTP
2015-03-23T14:01:16 SSH-2.0-1.36_sshlib EITS
2015-03-23T14:01:16 Starting SSH session. Remote Id: "SSH-2.0-1.36_sshlib EITS"
2015-03-23T14:01:16 Server Algorithm Suite
Key Exchange: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
Server Host Key: ssh-dss
Client to Server Encryption: twofish256-cbc,twofish-cbc,twofish128-cbc,blowfish-cbc,3des-cbc,arcfour,cast128-cbc,aes256-cbc,aes128-cbc,
Server to Client Encryption: twofish256-cbc,twofish-cbc,twofish128-cbc,blowfish-cbc,3des-cbc,arcfour,cast128-cbc,aes256-cbc,aes128-cbc,
Client to Server HMAC: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
Server to Client HMAC: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
Client to Server Compression: zlib,none
Server to Client Compression: zlib,none
2015-03-23T14:01:16 Selected Algorithm Suite
Key Exchange: diffie-hellman-group-exchange-sha1
Server Host Key: ssh-dss
Client to Server Encryption: aes128-cbc
Server to Client Encryption: aes128-cbc
Client to Server HMAC: hmac-sha1
Server to Client HMAC: hmac-sha1
Client to Server Compression: zlib
Server to Client Compression: zlib
2015-03-23T14:01:16 Client Algorithm Suite
Key Exchange: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
Server Host Key: ssh-ed25519,x509v3-ecdsa-sha2-nistp256,x509v3-ecdsa-sha2-nistp384,x509v3-ecdsa-sha2-nistp521,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,x509v3-rsa2048-sha256,x509v3-sign-rsa,x509v3-sign-dss,ssh-rsa,ssh-dss
Client to Server Encryption: aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc
Server to Client Encryption: aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc
Client to Server HMAC: hmac-sha1,hmac-md5,hmac-sha2-256,hmac-sha2-512
Server to Client HMAC: hmac-sha1,hmac-md5,hmac-sha2-256,hmac-sha2-512
Client to Server Compression: zlib@openssh.com,zlib,none
Server to Client Compression: zlib@openssh.com,zlib,none
2015-03-23T14:01:16 Key Exchange Algorithm: diffie-hellman-group-exchange-sha1
2015-03-23T14:01:18 Server "ssh-dss" host key fingerprint: 36:4d:b0:52:9e:5c:5f:9b:8b:f9:8b:ac:1b:61:5d:e1
2015-03-23T14:01:18 Key exchange completed.
2015-03-23T14:01:18 Requesting service "ssh-userauth".
2015-03-23T14:01:18 RTT: 484.091 ms
2015-03-23T14:01:18 Authentication request. Method: none
2015-03-23T14:01:18 Received authentication banner message.
2015-03-23T14:01:18 Server supported authentications: password,keyboard-interactive
2015-03-23T14:01:18 Authentication request. Method: password
2015-03-23T14:01:18 User authentication successful.
2015-03-23T14:01:18 SSH session established.
2015-03-23T14:01:18 Opening channel 0.
2015-03-23T14:01:19 Channel successfully opened (Local=0, Remote=0).
2015-03-23T14:01:19 Requesting subsystem "sftp" (Local=0, Remote=0).
 
This used to work fine until I had to move to a new server running Windows 7 which caused me to load the latest version of SmartFTP library.
Any thoughts?
 

What do you see in the SFTP log? You have to set the LogFile property of the SFTPConnection.
 
And does it work if you use the SmartFTP client?

I turned on the SFTP log and it shows:
2015-03-24T14:32:11 Uploading file to "<filename>.zip".
2015-03-24T14:32:11 StartPosition=0, EndPosition=0.
2015-03-24T14:32:11 2 File not found
 
I've tried it with the full path name. It seems like it can't see the file in my local directory.
 
When I tried it with SmartFTP client is shows:
[14:34:58] 1>257 "/toSFG/" is current folder.
[14:34:58] 1>TYPE A
[14:34:58] 2>150 Opening BINARY mode data connection for MLSD /.
[14:34:59] 1>200 Type set to A.
[14:34:59] 1>MODE Z
[14:34:59] 1>200 Mode set to Z.
[14:34:59] 1>PROT P
[14:34:59] 2>25 bytes transferred. (156 bytes/s) (160 ms)
[14:34:59] 1>200 PROT Command OK. Using Private data connection.
[14:34:59] 1>PASV
[14:34:59] 2>226 Transfer complete. 25 bytes (90 compressed @ 360.000000%) transferred. 90 Actual Bps, 25 Effective Bps.
[14:34:59] 1>227 Entering Passive Mode (<IP>,170,6).
[14:34:59] 1>Opening data connection to <IP> Port: 43526
[14:34:59] 1>MLSD
[14:34:59] 1>150 Opening BINARY mode data connection for MLSD /toSFG/.
[14:34:59] 1>16 bytes transferred. (99 bytes/s) (161 ms)
[14:34:59] 1>226 Transfer complete. 16 bytes (90 compressed @ 562.500000%) transferred. 90 Actual Bps, 16 Effective Bps.
[14:35:17] 1>CWD /toSFG
[14:35:17] 1>250 Folder changed to "/toSFG/".
[14:35:17] 1>PWD
[14:35:17] 1>257 "/toSFG/" is current folder.
[14:35:17] 1>MLST <filename>.zip
[14:35:17] 1>550 No such file or folder.
[14:35:17] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
 
It then adds the file to the transfer queue, and it is uploaded a few seconds later. I'm not sure what to make of it. Is it saying it can't find the file on my local drive, or is it saying it can't find the folder /toSFG/ on the host?
 
 

You are mixing things up. In SmartFTP you use the FTP protocol.
 
>2015-03-24T14:32:11 Uploading file to "<filename>.zip".
When you upload a file to a SFTP server you always have to use the fully qualified path (absolute path) because SFTP doesn't have a concept of a "working directory".
 
>2015-03-24T14:32:11 2 File not found
The error comes from the server.