OSS uses Function Compute to decompress ZIP packages that you upload.

Background information

Only ZIP objects can be decompressed in OSS. The following flowchart shows the decompression process.
Notice
  • ZIP package decompression is available in all regions except China (Heyuan), Malaysia (Kuala Lumpur), UAE (Dubai), and UK (London).
  • If the package contains object names or folder names that are not UTF-8 or GB 2312 encoded, the decompressed object names or directory names may be garbled, or the decompression process is interrupted. We recommend that you encode your object names or folder names in UTF-8 and GB 2312.
  • Archive objects or Cold Archive objects in ZIP packages cannot be decompressed if the objects are in the frozen state. Restore the Archive or Cold Archive objects before you decompress the ZIP packages.
  • If decompression takes more than 10 minutes, the ZIP package fails to decompress.
  • ZIP package decompression is a value-added service. When a ZIP package is decompressed, Function Compute calculates fees based on the amount of time it takes to decompress the package. For more information, see Billing methods.

Procedure

  1. Log on to the OSS console.
  2. Click Buckets, and then click the name of the target bucket.
  3. Choose Data Processing > Decompress ZIP Package.
  4. Click Decompress ZIP Package.
  5. In the Decompress ZIP Package dialog box that appears, configure the following parameters.
    Parameter Description
    Service Authorization To authorize Function Compute to read data from and write data to OSS and execute functions, click Authorize.
    Trigger Authorized To authorize OSS to access Function Compute, click Authorize.
    Prefix Specifies the prefix that object names must contain to trigger Function Compute. After you configure a prefix, Function Compute is triggered when the uploaded object name contains the same prefix. If you set Prefix to abc, Function Compute is triggered when the uploaded object name starts with abc or when an object is uploaded to the abc/ directory.
    Notice If this option is not configured, Function Compute is triggered for all ZIP objects in the bucket. The decompression tasks may be repeatedly run. For more information, see the "How to avoid cyclic triggering?" section in FAQs.
    Destination Directory Specifies the directory where the decompressed ZIP packages are stored. If this parameter is not set, Function Compute decompresses the ZIP packages to the root directory of the current bucket.
  6. Read and select I have read the terms of service and agreed to activate Function Compute and process compressed files by using Function Compute. Only files encoded in UTF-8 or GB 2312 can be processed. Click OK.

Modify configurations

After you complete configurations for ZIP package compression, you can modify these configurations at any time.

  1. Log on to the OSS console.
  2. Click Buckets, and then click the name of the target bucket.
  3. Choose Data Processing > Decompress ZIP Package.
  4. Click Edit in the Actions column corresponding to the entry to be modified. In the Edit Trigger dialog box that appears, modify Prefix for Trigger Rule.
    Notice By default, Suffix for Trigger Rule is configured by the system. If the suffix is modified, the decompression of the ZIP package will be affected.
  5. Click OK. Choose Overview > Configure.
  6. In the Configure Function dialog box that appears, optimize the configurations for Function Compute.
    You can modify the Memory, Timeout, and Environment Variables parameters as follows:
    • Memory: Configure this parameter based on the size of the object to be processed. If the size of the ZIP package is small, select a smaller value to save costs when the function is executed.
    • Timeout: A timeout error is displayed if the function cannot be executed during the specified period. We recommend that you configure an appropriate timeout period to avoid timeout during function execution.
    • Environment Variables: If you modify this parameter value, the destination directory of the decompressed object is modified.
  7. Click Submit.

Delete configurations

You can manually delete unnecessary configurations for Function Compute.

  1. Log on to the OSS console.
  2. Click Buckets, and then click the name of the target bucket.
  3. Choose Data Processing > Decompress ZIP Package.
  4. Click Edit in the Actions column corresponding to the entry whose configurations you want to modify. In the Edit Trigger dialog box that appears, click Cancel.
  5. On the Triggers tab that appears, click Delete in the Actions column corresponding to the entry to be deleted.
  6. In the message that appears, click OK.