Compress and decompress files

更新时间:
复制 MD 格式

To speed up file transfers, you can compress multiple files or large individual files before transferring them. This topic shows you how to compress and decompress files in the web hosting management console.

Prerequisites

An FTP client is installed. We recommend using FileZilla. You can click FileZilla to download the tool.

Limitations

Some shared web hosting instances do not support file compression and decompression. The available features depend on the options displayed in your management console.

The limitations for file compression and decompression depend on the operating system of your web hosting instance:

Important

To prevent failures caused by files being in use, perform these operations during off-peak hours when website traffic is low.

Host type

Description

Linux host

  • Files cannot be compressed or decompressed if their names contain Chinese characters, if they are password-protected, or if the destination directory name contains Chinese characters.

  • Only files in .zip and .tar formats can be decompressed.

Windows host

  • Files can be compressed and decompressed even if their names or the destination directory name contain Chinese characters. However, password-protected files cannot be compressed or decompressed.

  • Only files in .zip and .rar formats can be decompressed.

Compress files

To download large files from your web hosting instance, first compress them in the management console, and then use an FTP client to transfer them to your local host. The following steps use a Linux-based Exclusive Web Hosting instance (Advanced Edition) as an example.

  1. Log on to the Cloud Web Hosting management page.
  2. Find the Cloud Web Hosting instance that you want to manage and click Manage in the Actions column.
  3. In the navigation pane on the left, choose File Management > File Manager.
  4. On the File Manager page, click Website Root Directory.
  5. Find the file to compress and click Compress in the Actions column.

    The File Manager page lists all files and folders in the website root directory, along with their names, sizes, types, and modification dates.

  6. In the Compress File dialog box, configure the parameters and then click OK.

    The top of the File Compression dialog box displays notes on the compression operation, and below is an input form for configuration items.

    The following table describes the parameters.

    Parameter

    Description

    Example

    Destination directory

    The directory where the compressed file is saved.

    You can save the file in the website root directory or in a custom folder within the root directory.

    /

    The / directory represents the website root directory of the Linux host, which is /htdocs. For more information, see Directory structure of a Linux host and The htdocs directory cannot be found on the File Manager page.

    Compressed file name

    The name and format of the compressed file.

    test.tar.gz

    Overwrite existing file

    If a file with the same name already exists in the save directory, it is overwritten.

    Do not overwrite

  7. In the confirmation message that appears, click OK.

    Compression time depends on the file size. For large files (for example, over 80 MB), this process can take some time. Wait for about 30 minutes and then check the website root directory for the compressed file.

  8. Use an FTP client to connect to the web hosting instance.

    If you use FileZilla to connect to your web hosting instance, see Manage website files using FileZilla.

  9. Verify that the compressed file is in the specified directory.

    The compressed file is located in the /htdocs directory.

    For example, when you view the file list in an FTP client such as FileZilla, you can find the compressed file, such as test.tar.gz, in the directory.

Decompress files

To upload many files from your local host to your web hosting instance, first compress them into a single archive file. Then, use an FTP client to upload the archive and decompress it in the web hosting management console. The following steps use a Windows-based Exclusive Web Hosting instance (Standard Edition) as an example.

  1. Log on to the Cloud Web Hosting management page.
  2. Find the Cloud Web Hosting instance that you want to manage and click Manage in the Actions column.
  3. In the navigation pane on the left, choose File Management > File Manager.
  4. On the File Manager page, click Website Root Directory.
  5. Find the file to decompress and click Decompress in the Actions column.

    The File Manager page lists all files and folders in the website root directory, along with their names, sizes, types, and modification dates.

  6. In the File Decompression dialog box, configure the parameters and then click OK.

    The top of the File Decompression dialog box displays a prompt with notes about decompression (for example, password-protected files cannot be decompressed), and below are the input forms for the configuration options.

    The following table describes the parameters.

    Parameter

    Description

    Example

    Destination directory

    The path where the decompressed files are saved.

    You can save the files in the website root directory or in a custom folder within the root directory.

    /

    Overwrite existing files

    If a file with the same name exists in the destination directory, it is overwritten.

    Do not overwrite

  7. In the "Decompression successful" message that appears, click OK.

  8. Use an FTP client to connect to the web hosting instance.

    If you use FileZilla to connect to your web hosting instance, see Manage website files using FileZilla.

  9. Verify that the decompressed files are in the specified directory.

    The decompressed files are in the website root directory /.

    For example, when you view the directory with an FTP client such as FileZilla, you can see the decompressed files, such as test.log and test.zip.