(Visual FoxPro) Extract Files from MIME
Extract files from a MIME message.
LOCAL loMime
LOCAL lnSuccess
LOCAL loSa
LOCAL i
LOCAL n
* This example requires the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Mime')
loMime = CreateObject('Chilkat.Mime')
* Load a MIME document from a file:
* (.mht and .eml files contain MIME).
lnSuccess = loMime.LoadMimeFile("mst.mht")
IF (lnSuccess = 0) THEN
? loMime.LastErrorText
RELEASE loMime
CANCEL
ENDIF
loSa = loMime.ExtractPartsToFiles("/temp/mimeParts")
IF (loMime.LastMethodSuccess = 0) THEN
? loMime.LastErrorText
RELEASE loMime
CANCEL
ENDIF
i = 0
n = loSa.Count
* Display the filepaths of the files created:
DO WHILE i < n
? loSa.GetString(i)
i = i + 1
ENDDO
RELEASE loSa
RELEASE loMime
|