Type Function Library zip.* Return value none Revision 2017.3060 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.
Listener. The listener function invoked at the end of the operation.
local zip = require( "plugin.zip" ) -- Attempts to uncompress all files from "test.zip" to a destination folder. local function zipListener( event ) if ( event.isError ) then print( "Error!" ) else print( "event.name: " .. event.name ) print( "event.type: " .. event.type ) --example response --event.response = { --[1] = "space.jpg", --[2] = "space1.jpg", --} end end local zipOptions = { zipFile = "test.zip", zipBaseDir = system.ResourceDirectory, dstBaseDir = system.DocumentsDirectory, files = { "space.jpg", "space1.jpg" }, listener = zipListener } zip.uncompress( zipOptions )