Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

Container.Compress

Compresses a container value.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Container 5.3 Yes Yes Yes Yes Yes

MBS( "Container.Compress"; ContainerValue )

Parameters

Parameter Description Example value
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

Example Databases


CompileTime   -   Container.DecodeFromBase64

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins