Zip List Entries

List the contents of a ZIP file

SDK Method

file.zip_list_contents()

Return Object

ZipListEntry

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

import files_sdk

try:
  # Find the file object by its path.
  file = files_sdk.file.find(path)
  file.zip_list_contents()
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

The ZipListEntry Object

Some of the methods above return a ZipListEntry object. The attributes of this object are listed below.

AttributeDescription
path
string
Entry path inside the ZIP. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
size
int64
Uncompressed size in bytes.