Jump to content


Photo

FXP with SFTP


  • Please log in to reply
4 replies to this topic

#1 ds1

ds1
  • Members
  • 15 posts

Posted 23 February 2011 - 04:35 AM

I am trying to implement FXP using following code.

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?

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 23 February 2011 - 04:42 AM

Does it working using the SmartFTP client?

#3 ds1

ds1
  • Members
  • 15 posts

Posted 23 February 2011 - 04:00 PM

Yes, this works with the SmartFTP client.

#4 ds1

ds1
  • Members
  • 15 posts

Posted 07 March 2011 - 02:26 PM

Please help.

#5 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 07 March 2011 - 04:27 PM

Please provide a sample which reproduces the problem.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users