Zip List Entries

List the contents of a ZIP file

SDK Method

file.ZipListContents()

Return Values

Returns a files_sdk.ZipListEntryCollection value and an error.

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.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(zipListEntry)

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.