S3 ZIP Extension

AIStor implements an S3 extension to perform READ actions like download, list, or get metadata for individual files inside a ZIP archive stored in a bucket.

S3 requests can return information for individual files within the ZIP archive, including file size and custom headers.

To access ZIP archive contents, do the following:

  1. Set the x-minio-extract header to true in your S3 requests.
  2. Append the path of the content inside the archive to the path of the archive itself.

For example, to download 2025/taxes.csv archived in financial.zip and stored under a bucket named company-data, issue a GET request using the path:

company-data/financial.zip/2025/taxes.csv

Supported operations

The S3 ZIP extension supports the following read operations on files inside a ZIP archive:

  • HeadObject
  • GetObject
  • ListObjectsV2

The extension does not support write operations. To update or delete contents of a file inside a ZIP archive, replace the entire ZIP archive.

Requirements and limits

When using the S3 ZIP extension, you must meet the following requirements:

  • You must use ListObjectsV2 API calls to list ZIP file content.
  • Use AWS key naming guidelines to ensure safe path prediction.

The following limits apply when accessing ZIP archive contents:

  • ListObjectsV2 only reviews contents of the latest version of the ZIP in versioned buckets.
  • AIStor does not support Range requests for GetObject and HeadObject for individual files.
  • The ZIP file directory must be located within the last 100 MB.
  • A single ZIP file may contain up to 100 million files. However, MinIO recommends a limit of 100,000 files per ZIP file for optimal performance and memory usage.

Custom headers

AIStor reads custom headers for files inside ZIP archives from each file entry’s Comment field.

To set custom headers, use the following format in the Comment field when creating the ZIP:

x-minio-meta:{"<key>":"<value>"}

Custom header keys are prefixed with X-Amz-Meta- when returned in responses, with the following exceptions:

  • content-type - Returns as the Content-Type response header.
  • content-encoding - Returns as the Content-Encoding response header.
  • x-amz-tagging - Returns as the X-Amz-Tagging response header.

See the custom header example for how to create custom headers in several different languages and then verify the headers with curl.

Code examples

Access files inside a ZIP file

The following examples demonstrate accessing files inside a ZIP archive using various SDKs.

Create and verify custom headers

The following examples demonstrate creating a ZIP file with custom headers in different languages.

Upload the ZIP file to your bucket using the MinIO Client:

mc cp data.zip myminio/my-bucket/

Then retrieve a file from the ZIP with custom headers using curl:

# Retrieve the file from inside the ZIP archive
curl -X GET \
  -H "x-minio-extract: true" \
  --user ACCESS_KEY:SECRET_KEY \
  -i \
  http://localhost:9000/my-bucket/data.zip/report.csv

# Response includes custom headers:
# HTTP/1.1 200 OK
# Content-Type: text/csv
# X-Amz-Meta-Department: finance
# ...

Custom headers for individual files with the ZIP archive require AIStor Server RELEASE.2026-02-02T23-40-11Z or later.