Skip to content

datasource.zip ​

Zips one or more files into a single zip file.

js
datasource.zip(fileNames, outputFileName)

Parameters ​

ParameterTypeDescription
fileNamesstring | string[]The path of the file to zip, or an array of paths.
outputFileNamestringThe path of the zip file to create.

Returns ​

boolean

true when the zip file was created. false when the list is empty, a path is invalid or a file can't be found.

Examples ​

js
datasource.zip("myfile.txt", "output.zip");
datasource.zip(["file1.txt", "file2.txt"], "output.zip");