UCE Docs / zip_read

Signature

String zip_read(String zip_file_name, String entry_name)

Parameters

zip_file_name : path to the ZIP archive
entry_name : member name to read from the archive
return value : uncompressed entry contents

Reads one file member from a ZIP archive and returns its uncompressed bytes as a String.

entry_name is normalized to forward slashes and rejected when it is empty, absolute, drive-qualified, or contains a .. path segment.

Use zip_list() when you need to discover entry names before reading them.

Example

DValue entries;
entries["greeting.txt"] = "hello world";
zip_create("/tmp/doc-zipread.zip", entries);
print(zip_read("/tmp/doc-zipread.zip", "greeting.txt"), "\n");
Output
hello world