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

XML Embed Binary File

Demonstrates how to embed a binary file in XML. Also extracts binary data from XML and saves to a file.

Download Chilkat FileAccess ActiveX (freeware)

Download Chilkat XML ActiveX

LOCAL loFileData
LOCAL loFac
LOCAL loXml
LOCAL lnZipFlag
LOCAL lnEncryptFlag
LOCAL lcPassword
LOCAL lnSuccess
LOCAL lnFacSuccess



*  Load a binary file from disk:
loFac = CreateObject('Chilkat.FileAccess')
loFileData = loFac.ReadEntireFile("dude.gif")

loXml = CreateObject('Chilkat.Xml')

loXml.Tag = "gifData"

*  If set to 1, the binary data is automatically compressed
*  before being added to the XML.  In this example, GIF data
*  is already a compressed file format, so we another layer
*  of compression doesn't really help much...

lnZipFlag = 0

*  The data may be automatically 128-bit AES encrypted
*  if this flag is set to 1.

lnEncryptFlag = 0

lcPassword = "NotUsed"

lnSuccess = loXml.SetBinaryContent(loFileData,lnZipFlag,lnEncryptFlag,lcPassword)

*  Examine the XML.  (The binary content is base64-encoded)
? loXml.GetXml()

*  Now extract the content to a file:
lnSuccess = loXml.SaveBinaryContent("out.gif",lnZipFlag,lnEncryptFlag,lcPassword)
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loXml.LastErrorText)
ENDIF

*  The original data may be saved using the FileAccess component in this way:
lnFacSuccess = loFac.WriteEntireFile("original.gif", loFileData)
IF (lnFacSuccess = 0) THEN
    =MESSAGEBOX(loFac.LastErrorText)
    QUIT
ENDIF


© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · ASP Mail Component · XML Parser