Sample code for 30+ languages & platforms
AutoIt Requires Chilkat v11.0.0+

Unzip Files to Byte Array

See more Zip Examples

Demonstrates how to unzip each file contained in a .zip to an in-memory byte array.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

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

$oZip = ObjCreate("Chilkat.Zip")

$bSuccess = $oZip.OpenZip("qa_data/zips/test.zip")
If ($bSuccess = False) Then
    ConsoleWrite($oZip.LastErrorText & @CRLF)
    Exit
EndIf

;  Iterate of each entry in the zip.
;  An entry can be a file or directory entry.  For each file, unzip to a byte array.
Local $iNumEntries = $oZip.NumEntries
ConsoleWrite("NumEntries = " & $iNumEntries & @CRLF)

$oEntry = ObjCreate("Chilkat.ZipEntry")
Local $i = 0
While $i < $iNumEntries
    $oZip.EntryAt($i,$oEntry)
    If ($oEntry.IsDirectory = False) Then
Local $oFileData = $oEntry.Inflate()
        ;  Do whatever you wish with the file data...
    EndIf

    $i = $i + 1
Wend

$oZip.CloseZip 

ConsoleWrite("Finished." & @CRLF)