Lua
Lua
Open and Unzip an AES Encrypted Zip
See more Zip Examples
Open and unzip an AES encrypted Zip.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This example requires the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
local zip = chilkat.Zip.new()
local success = zip:open_zip("/myZips/aes.zip")
if not success then
print(zip.last_error_text)
return
end
-- Set the password needed to unzip.
-- This password must match the password used when the zip
-- was created.
zip.decrypt_password = "myPassword"
-- Unzip the .zip into /unzipDir.
-- Returns the number of files and directories unzipped.
local unzipCount = zip:unzip("/unzipDir/")
if unzipCount < 0 then
print(zip.last_error_text)
else
print("Success!")
end