Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
PassiveUseHostAddrSome FTP servers need this option for passive data transfers. In passive mode, the data connection is initiated by the client sending a PASV command to the FTP server, and the FTP server responds with the IP address and port number where it is listening for the client's connection request. When the PassiveUseHostAddr property is set, the IP address in the PASV response is discarded and the IP address of the remote endpoint of the existing control connection is used instead. LOCAL loFtp LOCAL lnSuccess LOCAL lcLocalFilename LOCAL lcRemoteFilename loFtp = CreateObject('Chilkat.Ftp2') * Any string unlocks the component for the 1st 30-days. lnSuccess = loFtp.UnlockComponent("Anything for 30-day trial") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF loFtp.Hostname = "ftp.chilkatsoft.com" loFtp.Username = "*myLogin" loFtp.Password = "*myPassword" * Connect and login to the FTP server. lnSuccess = loFtp.Connect() IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF * Set the PassiveUseHostAddr property. loFtp.PassiveUseHostAddr = 1 * Change to the remote directory where the file will be uploaded. lnSuccess = loFtp.ChangeRemoteDir("junk") IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF * Upload a file. lcLocalFilename = "hamlet.xml" lcRemoteFilename = "hamlet.xml" lnSuccess = loFtp.PutFile(lcLocalFilename,lcRemoteFilename) IF (lnSuccess <> 1) THEN =MESSAGEBOX(loFtp.LastErrorText) QUIT ENDIF loFtp.Disconnect() =MESSAGEBOX("File Uploaded!") |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser