Type Function
Library zip.*
Return value none
Revision Release 2024.3703
Keywords zip, uncompress
See also zip.compress()


Extracts (uncompresses) all files from a zip archive.


zip.uncompress( options )
options (required)

Table. A table of options for the function call — see the next section for details.

Options Reference

zipFile (required)

String. The zip file to extract files from.

zipBaseDir (required)

Constant. The base directory containing the zip archive.

dstBaseDir (required)

Constant. The destination folder to extract files to.

files (optional)

Array. A table specifying file names to extract from the archive. By default all files will be extracted.

password (optional)

String. The password which was used to encrypt the zip file (standard Zip 2.0 encryption).

listener (required)

Listener. The listener function invoked at the end of the operation.


local zip = require( "" )

local function zipListener( event )

    if ( event.isError ) then
        print( "Error!" )
        print ( event["type"] )  --> uncompress
        print ( event.response[1] )  --> space.jpg
        print ( event.response[2] )  --> space1.jpg

-- Attempts to uncompress all files from "" to a destination folder
local zipOptions =
    zipFile = "",
    zipBaseDir = system.ResourceDirectory,
    dstBaseDir = system.DocumentsDirectory,
    files = { "space.jpg", "space1.jpg" },
    listener = zipListener
zip.uncompress( zipOptions )