ZIP Append file(s) to a zip archive |
Top Previous Next |
This script command appends files to an existing zip archive or, if the /create option is specified, it creates a new zip file. Robo-FTP is compatible with the 64-bit zip algorithm so it can create zip archives with a theoretical limit of 18 million terrabytes.
Upon completion of the command, the %zipcount internal script variable contains the total number of files zipped by this command.
Caution With the ZIP command the [target] zip is specified before the [source] file to be archived. This is reversed from many of the other Robo-FTP script commands like UNZIP, PGPENCRYPT and PGPDECRYPT.
Consider the following example in which a single file is zipped into a new archive. The resulting archive file is named zipfile.zip and is located in Robo-FTP’s working folder.
ZIP "zipfile" "mydata.xml" /create
The following example adds another file to the same archive.
ZIP "zipfile" "mydata2.xml"
The example below adds all the .jpg and .jpeg files in Robo-FTP’s working folder to an existing password protected archive.
ZIP "zipfile" "*.jpg|*.jpeg" /pw=mysecret
The example below adds all the .xml files in Robo-FTP’s working folder and in any subfolders to an existing archive. Relative path names of any files found in subfolders are saved in the archive.
ZIP "zipfile" "*.xml" /subdirs
The example below stores (but does not compress) all the files in Robo-FTP’s working folder and in any subfolders in a new archive. Relative path names of any files found in subfolders are saved in the archive.
ZIP "c:\temp\archive.zip" "*" /subdirs /compress=none /create
Note: When the TMPFILE command is active, the output [ zip name ] created by this command will have a different name until the compression process is successfully completed.
Related command(s): UNZIP, PGPENCRYPT, PGPDECRYPT, TMPNAME See also: Data Compression |