Sample code for 30+ languages & platforms
Lianja

Extract Files from MIME

See more MIME Examples

Extract files from a MIME message.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loMime = createobject("CkMime")

// Load a MIME document from a file:
// (.mht and .eml files contain MIME).
llSuccess = loMime.LoadMimeFile("mst.mht")
if (llSuccess = .F.) then
    ? loMime.LastErrorText
    release loMime
    return
endif

loSt = createobject("CkStringTable")
llSuccess = loMime.PartsToFiles("/temp/mimeParts",loSt)
if (llSuccess = .F.) then
    ? loMime.LastErrorText
    release loMime
    release loSt
    return
endif

n = loSt.Count

// Display the paths of the files created:
i = 0
do while i < n
    ? loSt.StringAt(i)
    i = i + 1
enddo


release loMime
release loSt