Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Container.Compress
Compresses a container value.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Container | 5.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Container.Compress"; ContainerValue ) More
Parameters
Parameter | Description | Example |
---|---|---|
ContainerValue | The container value to compress. |
Result
Returns container value or error.
Description
Compresses a container value.Compression is not recommended for file formats which are normally compressed already. This includes PDF, various image formats like PNG and JPEG, video and audio files as well as zip archives.
Compression works very well for text files.
It is recommended to check with Container.GetTotalSize to see if compressed data is smaller. If you compress an already compressed container, the result may be bigger due to the archive header.
Compressed containers can be detected by looking if the type list returned by Container.GetTypes contains an item named ZLIB. You can use Container.GetTypeSize to query the size of compressed data alone.
Not recommended for bigger file sizes. Compression may take long enough that user doesn't like to wait. e.g. 20 seconds for 300 MB.
Examples
Compress container:
Set Field [Container Compression::Compressed; MBS("Container.Compress"; Container Compression::SomeContainer)]
See also
- Container.Decompress
- Container.GetTotalSize
- Container.GetType
- Container.GetTypes
- Container.GetTypeSize
- Container.IsCompressed
Release notes
- Version 9.1
- Rewrote Container.Compress and Container.Decompress to work faster.
Example Databases
Blog Entries
- Store large texts as container fields
- MBS FileMaker Plugin, version 9.1pr1
- Comparing Base Elements Plugin to MBS FileMaker Plugin
- [ANN] MBS FileMaker Plugin 5.3 for OS X/Windows
- MBS FileMaker Plugin, version 5.3pr4
- Compressed Containers
This function is free to use.
Created 15th September 2015, last changed 21st September 2015