The readZip(...) function is used read the files inside a zip archive and inspect the properties of those files.  The result of readZip(...) is an array of ZipEntryReader objects index sequentially starting at 0.  ZipEntryReader objects are detailed below, including an example.

Syntax:
readZip( url )
url.readZip( )

Parameter Description
url A String value giving the url where the zip file can be found.

ZipEntryReader Object

Field/Function Description
filename The name of the file stored in the zip archive.  If the file is inside a folder, the filename includes the full path to the file as well as the filename.
size The uncompressed size of the file in bytes.  This value may be -1 if the size is unknown.
compressedSize The compressed size of the file in bytes.  This value may be -1 if the size is unknown.
time A DateTime value indicating the last modification timestamp.  This value may be null if the modification date is unknown.
crc The CRC value of the file.  This is used to verify data integrity if there is a possibility that the zip file has been tampered with.
comment A comment that is stored with the file inside the zip archive.  It is unlikely this will ever be anything other than null.
getContent(charset) Gets the uncompressed contents of the file from inside the zip archive.  The function recieves one optional additional parameter, the name of the charset used to decode the bytes into a String value.  The default is UTF-8.  For binary files you should use the special value "BASE64" which gets the file as a Base64 encoded String compatible with other RelateScript functions such as document fields which can store the file.

Example:

The following code reads a zip file from the internet and displays the contents of the archive:

rowF = getFormatter('<li>"{3}" size: {4}({1}); crc: {2}; time: {5}<br>{0}</li>');
files = readZip('https://github.com/downloads/hunterhacker/jdom/jdom-2.0.2.zip');
out = '<ul>'
for (i, file in files) {
    out += rowF.format(
        file.comment, 
        file.compressedSize, 
        file.crc, 
        file.filename, 
        file.size, 
        file.time
    );
}
out += '</ul>'
The result is the following HTML: