Previous Topic

Next Topic

ZipFiles - MaxBasic Function

ZipFiles(FileName: String, FileList: String[, BasePath: String])

Creates or adds to the file specified in Filename, from a comma separated list of files specified in FileList.

Note: folders can be included as long as a filemask is also included, for example, "c:\Exports\*.csv". See the example below.

An optional Base Path for the files to zip can be specified. If this is included then all files in the file list must be in relative paths. Base path is inferred if only one file or filemask is passed in the file list.

ZipFiles function syntax has these named arguments:

Parameter

Description

File Name

Required. The zip or 7z file name to be created or added to.
If extension 7z is used file will be a 7 zip archive.

File List

Required. The files to be added to the zip or 7z file.

Base Path

Optional. The base path for the files in the list.

For example:

  Zipfiles("c:\test.zip", "c:\File1.csv,c:\Exports*.csv")

will create test.zip file, and add all csv file from c:\Exports and also c:\file1.csv.

  Zipfiles("c:\test.7z", "*.csv,*.txt","c:\Exports\")

will create test.7z file, and add all csv and txt files from c:\Exports.

See Also

Script Functions

Book Contents

Book Index