Name Date Size

..25-Oct-20244 KiB

.gitignoreH A D25-Oct-2024121

AppScope/H25-Oct-20244 KiB

build-profile.json5H A D25-Oct-20241.1 KiB

entry/H25-Oct-20244 KiB

hvigor/H25-Oct-20244 KiB

hvigorfile.tsH A D25-Oct-2024158

hvigorwH A D25-Oct-20242.1 KiB

hvigorw.batH A D25-Oct-20242 KiB

oh-package.json5H A D25-Oct-2024812

ohosTest.mdH A D25-Oct-20241.6 KiB

README.mdH A D25-Oct-20241.3 KiB

README_zh.mdH A D25-Oct-20247.7 KiB

screenshots/device/H25-Oct-20244 KiB

README.md

1# Zip and Unzip
2
3### Introduction
4
5This sample demonstrates the use of @ohos.zlib. Below shows the sample app.
6
7![](screenshots/device/main.png)
8
9### Concepts
10
11Zip: compresses a file or folder based on the passed file path to zip and the path of the zipped file.
12
13Unzip: decompresses a file or folder based on the passed file path to unzip and the path of the unzipped file.
14
15### Required Permissions
16
17N/A
18
19### Usage
20
211. Touch **+** in the upper right corner of the sample app.
22
232. In the **Create file** dialog box displayed, enter the file name and content, and touch **OK**.
24
253. The file created is displayed on the home page. Touch **Zip**. A message is displayed, indicating that the file is compressed, and a **.zip** file with the same name is created in the file list.
26
274. Touch **Unzip** next to the zipped file. A message is displayed, indicating that the file is decompressed, and a folder with the same name is created in the file list.
28
29### Constraints
30
311. This sample can only be run on standard-system devices.
32
332. This sample requires DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100, built on November 3, 2022) to compile and run.
34
353. The paths passed in the `Zip` and `Unzip` APIs must be the relative paths obtained by the context API. Currently, `Zip` and `Unzip` support operations only on files in the app directory.
36