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.

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

Syntax

function addToArchive(archiveData: any): string

The archiveData object has the following structure:

{
	'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