Skip to content

ZIP extraction

Extracting ZIP archives with x-minio-extract, and its limits.
Note

Read-only ZIP member extraction (x-minio-extract: true) is a Preview extension in the MVP release.

Introduced in schema 13 and retained in schema 14, the PostgreSQL backend can expose members inside a stored .zip object as read-only virtual objects over S3. The gateway never extracts files onto local disk, creates separate object rows, or persists a ZIP index in PostgreSQL.

Request forms

Include x-minio-extract: true on a GET or HEAD request whose key path traverses inside a .zip archive:

GET /attachments/archive.zip/docs/readme.txt HTTP/1.1
Host: s3.example.net
x-minio-extract: true
Authorization: AWS4-HMAC-SHA256 ...

To list archive members, send a ListObjectsV2 request (list-type=2) with x-minio-extract: true and a prefix containing .zip/:

GET /attachments?list-type=2&prefix=archive.zip%2F HTTP/1.1
Host: s3.example.net
x-minio-extract: true
Authorization: AWS4-HMAC-SHA256 ...

The first .zip/ boundary in the key identifies the parent archive object. In a.zip/b.zip/c.txt, the parent archive is a.zip and the requested member path is b.zip/c.txt; nested archives are not recursively opened. Without x-minio-extract: true, requests treat the full key as an ordinary S3 object name. For runnable SDK code, see Annotations & ZIP Extraction.

Authorization and snapshot isolation

  • Reading a member requires s3:GetObject on the parent .zip object (or s3:GetObjectVersion when versionId is specified). Listing members additionally requires s3:ListBucket. Under iam_and_pg joint authorization, only SELECT on the bucket ACL relation is required.
  • Central directory parsing, member decompression, parent version metadata, and SSE decryption all read from a single pinned PostgreSQL snapshot. Concurrent S3 or SQL overwrites, version deletions, or bucket recreations cannot swap the underlying archive segments mid-read.
  • SSE-C and static SSE-S3 encrypted .zip archives are supported through the standard parent decryption path, and read-only standby gateways (SILO_PG_READ_ONLY=on) can serve ZIP extraction requests.

Archive format and resource limits

ParameterLimit
Compression methodsStore (0) and Deflate (8)
ZIP64 descriptorsSupported within the size bounds below
Central directory size<= 16 MiB
Central directory entries<= 10000 entries
Single uncompressed member size<= 256 MiB
Total declared uncompressed archive size<= 1 GiB
Per-request execution timeout<= 1 minute (or shorter outer request timeout)
Member Range or partNumber readsUnsupported (rejected)
Password-protected / encrypted ZIP or multi-disk archivesUnsupported (rejected)

The gateway rejects archives with trailing or corrupt central directory records, out-of-range offsets, duplicate member names, absolute paths, .. path traversal segments, or special file types.

GET vs. HEAD execution cost

Before streaming a GET response body, the gateway validates the target member’s uncompressed size and CRC-32 across the member stream, then streams the decompressed payload from the same database snapshot. Consequently, every member GET performs two decompression passes. HEAD returns member metadata (Content-Length set to uncompressed size, Content-Type inferred from file extension) from the central directory without decompressing the member body.

Each extraction request holds its database connection and snapshot until the stream finishes or times out. For workloads that repeatedly read individual members at high concurrency, unpack and store those files as independent S3 objects instead.

Scan to open this page
https://mimus.pgsty.com/docs/s3/reference/zip/