Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
FTP over SSL 3.0 on Port 990
Visual Foxpro example program showing how to establish an SSL 3.0 secure FTP channel on port 990 and do file uploads and downloads.
* This Visual Foxpro example demonstrates how to do secure FTP uploads and downloads
* using implicit SSL 3.0 on FTP port 990. This is a less common way of doing secure FTP.
* If the FTP client is behind a network address translating router, such as a typical
* DSL/Cable router, this will not work when the transfer mode is Active, as opposed to Passive.
* The reason is that the router cannot translate the IP address issued in the PORT command
* when setting up the data channel. To do secure FTP behind a router, use "AUTH TLS"
* instead. (refer to http://www.example-code.com/foxpro/ftps-visual-foxpro.asp )
LOCAL loFtp, lnSuccess, lcLocalFilename, lcRemoteFilename
loFtp = CreateObject('Chilkat.Ftp2')
loFtp.UnlockComponent('Anything for 30-day trial')
* Set the AuthTls property = false.
ftp.AuthTls = False
* Set Ssl = True and the port must be 990:
ftp.Ssl = True
ftp.Port = 990
loFtp.HostName = "ftp.myHost.com"
loFtp.Username = "myLogin"
loFtp.Password = "myPassword"
lnSuccess = loFtp.Connect()
IF ( lnSuccess = 0 )
=MESSAGEBOX(loFtp.LastErrorText)
RELEASE loFtp
RETURN .T.
ENDIF
* Download a file, keeping the same filename on the FTP server.
lcLocalFilename = "myFile.txt"
lcRemoteFilename = "myFile.txt"
lnSuccess = loFtp.GetFile(lcRemoteFilename, lcLocalFilename)
IF ( lnSuccess = 0 )
=MESSAGEBOX(loFtp.LastErrorText)
RELEASE loFtp
RETURN .T.
ENDIF
* To upload a file, use PutFile instead of GetFile. Note: the order
* of local/remote filenames is reversed:
lnSuccess = loFtp.PutFile(lcLocalFilename, lcRemoteFilename)
IF ( lnSuccess = 0 )
=MESSAGEBOX(loFtp.LastErrorText)
RELEASE loFtp
RETURN .T.
ENDIF
=loFtp.Disconnect()
RELEASE loFtp
RETURN .T.
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser