OSS can automatically decompress ZIP packages uploaded to buckets. After you configure decompression rules, all ZIP packages uploaded to the folders specified in the rules are automatically decompressed.
Prerequisites
Background information

When you upload a ZIP package that matches the configured decompression rules to OSS, Function Compute is triggered to automatically decompress the ZIP package. Objects decompressed from the ZIP package are stored in the specified folder in OSS.
Usage notes
Take note of the following items when you use the ZIP package decompression feature:
- ZIP package decompression is available in all regions except the following regions: China (Heyuan), China (Guangzhou), China (Ulanqab) and UAE (Dubai).
- We recommend that you encode your object or folder names in UTF-8 or GB 2312. Otherwise, the decompressed object or folder names may be corrupted or the decompression process may be interrupted.
- If the storage class of a ZIP package is Archive or Cold Archive, you must restore the object before it can be decompressed.
- If the decompression of a ZIP package takes more than 10 minutes, the ZIP package fails to be decompressed.
- ZIP package decompression is a value-added service. Function Compute calculates the fees based on the amount of time it takes to decompress ZIP packages. For more information, see Billing methods.
Configure decompression rules for ZIP packages
Modify the decompression rules for ZIP packages
You can modify the decompression rules for ZIP packages.
- Modify the prefix
- Click the Decompress ZIP Package tab.
- Click Edit in the Actions column corresponding to the trigger you want to modify.
- On the Edit Trigger page in the Function Compute console, modify the Prefix value in the Trigger Rule section. Keep other parameters unchanged.
- Click OK.
- Modify function configurations
- Click the Decompress ZIP Package tab.
- Click Edit in the Actions column corresponding to the trigger you want to modify.
- On the Edit Trigger page in the Function Compute console, click Cancel.
- Click the Overview tab. Click Configure.
- On the Configure Function page, modify the function configurations.
You can modify the Memory, Timeout, and Environment Variables parameters:
- Memory: You can configure this parameter based on the size of the object to be processed. If the size of the ZIP package is small, set this parameter to a small value to reduce 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 extracted objects is modified.
- Click Submit.
Delete decompression rules for ZIP packages
You can manually delete decompression rules for ZIP packages.
- Click the Decompress ZIP Package tab.
- Click Edit in the Actions column corresponding to the trigger you want to delete.
- On the Edit Trigger page, click Cancel.
- On the Triggers tab, click Delete in the Actions column corresponding to the trigger you want to delete.
- In the dialog box that appears, click OK.