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.

FileZipListContentsParams Fields

FieldDescription
Path
string
Required
Path to operate on.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    "github.com/Files-com/files-sdk-go/v3/file"
)

zipListEntry, err := file.ZipListContents(files_sdk.FileZipListContentsParams{Path: "path"})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

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.