Updated on 2024-03-04 GMT+08:00

Online Decompression

You can compress multiple files into a ZIP package and upload it to OBS.

OBS automatically decompresses ZIP packages after they are uploaded.

Scenarios

  • Upload a ZIP package to an OBS bucket and then have the package automatically decompressed and stored in a specific directory.
  • Upload a large number of small files at a time by using a ZIP package to save time and efforts. For batch upload constraints, see OBS Batch Upload.

Prerequisites

You have been assigned the Tenant Administrator role.

Constraints

Permissions

  • To configure, obtain, or delete online decompression policies, you must have the Tenant Administrator permission assigned by using IAM.

Regions

  • Online decompression is only available in some regions. For details, see Function Overview.

Package and file size

  • A single ZIP package cannot exceed 1 GB in size.
  • A single ZIP package can contain a maximum of 65,536 files.
  • A single decompressed file cannot exceed 40 GB in size.

Time

  • Decompressing a ZIP package takes 10 minutes at most.

Functions

  • Currently, only ZIP packages are supported.
  • ZIP package names cannot contain Chinese punctuation marks, special characters, or special codes.
  • To decompress the ZIP package that contains other ZIP packages, the event type of the online decompression policy must be set to ObjectCreated:* or ObjectCreated:CompleteMultipartUpload.
  • Currently, no notification will be sent to users after decompression tasks are complete.
  • Currently, only deflate-compressed ZIP packages can be decompressed. Deflate is different from the compression algorithms (such as Store and Normal) provided by WinRAR.
  • The total length of the decompression path plus the name of any decompressed file cannot exceed 512 characters.
  • Currently, encrypted ZIP packages cannot be decompressed.

Precautions

  • You are advised to set a precise prefix for a decompression policy. In the same bucket, trigger conditions (including events, prefixes, or suffixes) of different decompression policies cannot overlap with each other.

    For example, there are two decompression policies event-0001 and event-0002 in a bucket. If the prefix of event-0001 is aa, the prefix of event-0002 cannot be aaaa, because aa is contained in aaaa.

  • If the prefix is left blank, the decompression policy applies to all the ZIP packages in the bucket by default. This may trigger cyclic decompression if a package contains other packages.

    For example, package AA.zip contains another package BB.zip. If the prefix is left blank, the system continues to decompress BB.zip after decompressing AA.zip. This issue will not happen if a prefix is set in the policy.

  • You must set a directory for storing the decompressed files. If the directory is not set, decompressed files will be stored in the home directory of the current bucket.
  • You are advised to encode file or folder names using UTF-8. Otherwise, names of decompressed files or folders may contain garbled characters, or the decompression may be interrupted.
  • If you want ZIP packages in the Archive storage class to be automatically decompressed upon upload, ensure that Direct Reading has been enabled for the bucket. ZIP packages in the Deep Archive storage class will not be automatically decompressed after they are uploaded to an OBS bucket.
  • A ZIP package decompression will fail if it takes more than 10 minutes.

How to Use

Configure the policies for decompressing ZIP packages online through OBS Console or APIs.