Compressfiles

This 4GL function compresses folders or files into ZIP format on the application server.

Use COMPRESSFILES to create a ZIP file containing one or more files or a directory tree.

Syntax

RETURN_VALUE = func ORDSYS.COMPRESSFILES(ORINAME, DSTNAME, COMPRESSIONLEVEL, INCLUDEOPTION)

You need to specify the full path containing the destination directory.

  1. Indicate the folder or file name to compress with its full path in the ORINAME parameter.

  2. Enter the destination folder and ZIP file name with the full path in the DSTNAME parameter.

  3. Select a compression option with one of the following values for the COMPRESSIONLEVEL parameter:

  4. Configure the INCLUDEOPTION parameter to specify the tree structure contained in the ZIP file:

    INCLUDEOPTION example

    You want to compress the following tree structure on your PC:

    • C:\Test\file1.txt

    • C:\Test\file2.txt

    • C:\Test\Example\file3.txt

      INCLUDEOPTION value 0 1 2
      ZIP file's tree structure
      • Test\file1.txt

      • Test\file2.txt

      • Test\Example\file3.txt

      • file1.txt

      • file2.txt

      • Example\file3.txt

      • file1.txt

      • file2.txt

If an error occurs, a status other than 0 is returned, and a trace file is created in the [TRA] folder. Otherwise, only a status equal to 0 is returned.