FXP with SFTP

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
Post Reply
ds1
Posts: 15
Joined: Fri Feb 04, 2011 4:59 am

FXP with SFTP

Post by ds1 » Wed Feb 23, 2011 4:35 am

I am trying to implement FXP using following code.

Code: Select all

		Dim objFXP As New sfFTPLib.FTPFXP

		Dim ftpSource as New sfFTPLib.FTPConnectionMTA

		Dim ftpDest as New sfFTPLib.FTPConnectionMTA

		Dim enumReturned As sfFTPLib.enumError



                        ftpSource.Host = "testServerOne"

                        ftpSource.Port = 21

                        ftpSource.Username = "test"

                        ftpSource.Password = "test"

                        ftpSource.Passive = true

                        ftpSource.DataProtection = enumDataProtection.ftpDataProtectionPrivate



                        ftpDest.Host = "testServerTwo"

                        ftpDest.Port = 21

                        ftpDest.Username = "test"

                        ftpDest.Password = "test"

                        ftpDest.Passive = false

                        ftpDest.DataProtection = enumDataProtection.ftpDataProtectionPrivate



		objFXP.Source = _objFTPS

		objFXP.Destination = objDestination



		enumReturned = objFXP.FXPFile(fileName, fileName, 0, 0)



		If enumReturned = sfFTPLib.enumError.ftpErrorSuccess Then

			System.Console.writeLine("Success")

			'ftpSource .Continue()

			'ftpDest .Continue()

		Else

			System.Console.writeLine("Error Ocurred= " & objFXP.LastError.ToString)

		End If


When I execute the above code, it does not always work - sometimes the file is transferred, other times it gives error as "ftpErrorPending" and does nothing, and yet other times it gives the error and the file is transferred completely.


Here is the log for source:

PASV Host: 202.189.230.246
227 Entering Passive Mode (202,189,230,246,45,110) Host: 202.189.230.246
Opening data connection to 202.189.230.246 Port: 11630 Host: 202.189.230.246
MLSD Host: 202.189.230.246
TransferStart -------------------- Customized message
OnTransferProgress: Low=0, High=0 -------------------- Customized message
150 Opening data connection Host: 202.189.230.246
1009 bytes transferred. (Unknown/s) (0 ms) Host: 202.189.230.246
OnTransferEnd -------------------- Customized message
226 Transfer complete Host: 202.189.230.246
OnTransferInit -------------------- Customized message
DownloadFXPFile: RemoteFile=TestFile.txt, Low=0, High=0 -------------------- Customized message
Error Ocurred= ftpErrorPending


Anyone have suggestions?

mb
Posts: 12030
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: FXP with SFTP

Post by mb » Wed Feb 23, 2011 4:42 am

Does it working using the SmartFTP client?

ds1
Posts: 15
Joined: Fri Feb 04, 2011 4:59 am

Re: FXP with SFTP

Post by ds1 » Wed Feb 23, 2011 4:00 pm

Yes, this works with the SmartFTP client.

ds1
Posts: 15
Joined: Fri Feb 04, 2011 4:59 am

Re: FXP with SFTP

Post by ds1 » Mon Mar 07, 2011 2:26 pm

Please help.

mb
Posts: 12030
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: FXP with SFTP

Post by mb » Mon Mar 07, 2011 4:27 pm

Please provide a sample which reproduces the problem.

Post Reply