FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
Bzip2
LZW
Bz2
Icon

 

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


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