Zip List Entries

List the contents of a ZIP file

SDK Method

file.zipListContents()

Return Object

ZipListEntry

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

import File from 'files.com/lib/models/File';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const file = new File();
  await file.zipListContents();
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw 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.