ftos.files.addToArchive

IMPORTANT!  
Starting with v24.3.0, this is renamed from addToArchive to ftos.files.addToArchive.

Creates a .zip archive with the specified files and saves it in the file upload location. The archived files must also be stored in the file upload location.

Make sure that the .zip file extension is defined in the FileUploadWhiteList key in the Configuration Manager.

This is a business logic method for business service components.

Syntax

Copy
function ftos.files.addToArchive(archiveData: any): string

The archiveData object has the following structure:

Copy
{
    'fileNames': [
        {
            'Name': '<in-archive file 1 name>',
            'RealName': '<file 1 real name>'
        },
        {
            'Name': '<in-archive file 2 name>',
            'RealName': '<file 2 real name>'
        },
        ...
    ],
    'archiveName': '<archive name>',
    'password': '<archive password>' //optional
}
 
Parameter Description
fileNames Array of JSON objects containing the archived files' names.
Name Name of the file as it will be saved inside the .zip archive.
RealName Unique internal ID of the source file (real name).
archiveName Name of the archive, including the .zip file extension.
password optional Keyword used to password-protect the archive.

Return Value

Returns a string containing the saved archive's real name.

Examples