Type Function Library zip.* Return value none Revision Release 2022.3683 Keywords zip, uncompress See also zip.compress() zip.list()
Extracts (uncompresses) all files from a zip archive.
zip.uncompress( options )
Table. A table of options for the function call — see the next section for details.
String. The zip file to extract files from.
Constant. The base directory containing the zip archive.
Constant. The destination folder to extract files to.
Array. A table specifying file names to extract from the archive. By default all files will be extracted.
String. The password which was used to encrypt the zip file (standard Zip 2.0 encryption).
Listener. The listener function invoked at the end of the operation.
local zip = require( "plugin.zip" ) local function zipListener( event ) if ( event.isError ) then print( "Error!" ) else print ( event["type"] ) --> uncompress print ( event.response[1] ) --> space.jpg print ( event.response[2] ) --> space1.jpg end end -- Attempts to uncompress all files from "test.zip" to a destination folder local zipOptions = { zipFile = "test.zip", zipBaseDir = system.ResourceDirectory, dstBaseDir = system.DocumentsDirectory, files = { "space.jpg", "space1.jpg" }, listener = zipListener } zip.uncompress( zipOptions )