FoxPro Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Amazon S3
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

Secure FTP (FTPS) Upload and Download

Download 32-bit Chilkat FTP2 ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

Visual Foxpro example program showing how to do FTPS (Secure FTP) file transfers.

* This Visual Foxpro FTPS sample shows to how do secure FTP uploads and
* downloads using AUTH TLS.

* Secure FTP (FTPS) using AUTH TLS
*
* What is TLS?
* Transport Layer Security (TLS) is the successor to
* Secure Sockets Layer (SSL). It is a cryptographic protocol that
* provides secure communications on the Internet for such things as
* email, FTP, and other data transfers. There are slight differences
* between SSL 3.0 and TLS 1.0, but the protocols are substantially the
* same.

* The most common method of doing secure FTP file transfers is
* by AUTH TLS (also known as AUTH SSL).
* The client connects on the standard unencrypted FTP port 21
* and then issues an "AUTH TLS" command to convert the TCP/IP channel
* to a TLS encrypted channel.  All communications from that point onward,
* including data transfers, are encrypted.

LOCAL loFtp, lnSuccess, lcLocalFilename, lcRemoteFilename

loFtp = CreateObject('Chilkat.Ftp2')
loFtp.UnlockComponent('Anything for 30-day trial')

* Set the AuthTls property = 1.
loFtp.AuthTls = 1

* Leave the Ssl property = 0.  The Ssl property is used
* for doing Secure FTP over SSL on port 990 (implicit SSL)
* FTP Implicit SSL is covered in another example.
loFtp.Ssl = 0

loFtp.HostName = "ftp.myHost.com"
loFtp.Username = "myLogin"
loFtp.Password = "myPassword"

* Connect and login to the FTP server.  This establishs a control connection
* to the FTP server (port 21), converts the channel to TLS (because AuthTls is true),
* and then authenticates.
lnSuccess = loFtp.Connect()
IF ( lnSuccess = 0 )
	=MESSAGEBOX(loFtp.LastErrorText)
	RELEASE loFtp
	RETURN .T.
ENDIF

* You may need to clear the control channel if your FTP client
* is located behind a network-address-translating router
* such as with a Cable/DSL router.
* =loFtp.ClearControlChannel()

* 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

* Note: if PutFile fails and you get this in your LastErrorText:
* PortReply: 530 Only client IP address allowed for PORT command.
* It indicates that you must first clear the control channel
* because your FTP client sits behind a router doing NAT (network
* address translation).  The router is not able to translate the
* IP address in the PORT command if the control channel is encrypted.

* 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