Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Creates a new archive.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Archive | 13.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
Format | The format to use. Formats: 7zip, ar, arbsd, argnu, arsvr4, bsdtar, cd9660, cpio, gnutar, iso, iso9660, mtree, mtree-classic, newc, odc, oldtar, pax, paxr, posix, raw, rpax, shar, shardump, ustar, v7tar, v7, warc, xar, zip. |
"zip" | |
Filter | The filter to use. For zip format can be store or deflate. Filters: b64encode, bzip2, compress, grzip, gzip, lrzip, lz4, lzip, lzma, lzop, uuencode, xz, zstd. Not all filters can be combined with all formats. |
"deflate" | |
Destination | The native file path to the destinaton archive. Or empty or file name for container. |
"C:\test.zip" | Optional |
Options | The options to pass to writer. This is a comma-separated list of options. Option names can be prefixed with module name. Sample options: compression-level=9 zip:encryption=zipcrypt zip:encryption=aes128 zip:encryption=aes256 zip64 gzip:compression-level=9 hdrcharset=UTF-8 |
"compression-level=9¶hdrcharset=UTF-8" | Optional |
Password | The passphrase to use for password protection. Usually only used when an encryption option is set. |
"secret" | Optional |
Returns OK or error.
Create a zip file on desktop:
Set Variable [ $r ; Value: MBS( "Archive.Create"; "zip"; "deflate"; "/Users/cs/Desktop/test.zip") ]
# add a file from desktop folder:
Set Variable [ $r ; Value: MBS( "Archive.AddFile"; "test.png"; "/Users/cs/Desktop") ]
# add a text file:
Set Variable [ $r ; Value: MBS( "Archive.AddText"; "Hello World!"; "UTF-8"; "test.txt") ]
# add something from container field:
Set Variable [ $r ; Value: MBS( "Archive.AddContainer"; Kontakte::Foto) ]
# and close file.
Set Variable [ $r ; Value: MBS( "Archive.Close") ]
Create a zip and store in container:
Set Variable [ $r ; Value: MBS( "Archive.Create"; "zip"; "deflate"; "test.zip") ]
# add file from desktop:
Set Variable [ $r ; Value: MBS( "Archive.AddFile"; "test.png"; "/Users/cs/Desktop") ]
# add a text file:
Set Variable [ $r ; Value: MBS( "Archive.AddText"; "Hello World!"; "UTF-8"; "test.txt") ]
# add a picture:
Set Variable [ $r ; Value: MBS( "Archive.AddContainer"; MyTable::MyPhoto) ]
# close and get the container value:
Set Variable [ $container ; Value: MBS( "Archive.Close") ]
# Store in a Field:
Set Field [ MyTable::MyZip ; $container ]
Commit Records/Requests [ With dialog: Off ]
Compress PDF containers into a zip file:
Set Variable [ $path ; Value: MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ); "test.zip" ) ]
Set Variable [ $r ; Value: MBS( "Archive.Create"; "zip"; "deflate"; $path) ]
If [ MBS("IsError") ]
Show Custom Dialog [ "Failed to create zip archive." ; $r ]
Exit Script [ Text Result: ]
End If
#
Go to Record/Request/Page [ First ]
Set Variable [ $destPage ; Value: 1 ]
Loop
Set Variable [ $r ; Value: MBS( "Archive.AddContainer"; Merge PDFs::InputPDF) ]
Go to Record/Request/Page [ Next ; Exit after last: On ]
End Loop
Set Variable [ $r ; Value: MBS( "Archive.Close") ]
Create 7zip archive:
MBS( "Archive.Create"; "7zip"; ""; $path)
This function checks for a license.
Created 13th February 2023, last changed 8th June 2023