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

List Files in a .zip

See more Zip Examples

How to list files within a .zip

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

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

Dim zip As ChilkatZip
zip.Initialize("zip")

success = zip.OpenZip("a.zip")
If success = False Then
    Log(zip.LastErrorText)
    Return
End If


'  Get the number of files and directories in the .zip
Dim n As Int = zip.NumEntries

Dim entry As ChilkatZipEntry
entry.Initialize("entry")

Dim i As Int = 0

Do While i < n
    zip.EntryAt(i, entry)
    If entry.IsDirectory = False Then
        '  (the filename may include a path)
        Log(entry.FileName)
    End If

    i = i + 1
Loop