4D v16.3COMPRESS BLOB |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
COMPRESS BLOB
COMPRESS BLOB
The COMPRESS BLOB command compresses the BLOB blob using a compression algorithm. This command only compresses BLOB whose size is over 255 bytes. The optional compression parameter allows to set the way the BLOB will be compressed. You can pass one of the following constants, placed in the BLOB theme:
If you pass another value or if you omit the compression parameter, compression mode 1 is used (compact internal compression). Note: This command only compresses BLOBs that are greater than or equal to 255 bytes. After the call, the OK variable is set to 1 if the BLOB has been successfully compressed. If the compression could not be performed, the OK variable is set to 0. If the compression could not be performed because of a lack of memory or because the actual size of the blob is less than 255 bytes, no error is generated and the method resumes its execution. After a BLOB has been compressed, you can expand it using the EXPAND BLOB command. To detect if a BLOB has been compressed, use the BLOB PROPERTIES command. WARNING: A compressed BLOB is still a BLOB, so there is nothing to stop you from modifying its contents. However, if you do so, the EXPAND BLOB command will not be able to decompress the BLOB properly. This example tests if the BLOB vxMyBlob is compressed, and, if it is not, compresses it: BLOB PROPERTIES(vxMyBlob;$vlCompressed;$vlExpandedSize;$vlCurrentSize) Note however, that if you apply COMPRESS BLOB to an already compressed BLOB, the command detects it and does nothing. This example allows you to select a document and then compress it: $vhDocRef :=Open document("") Sending of raw HTTP data compressed with GZIP: COMPRESS BLOB($blob;GZIP Best compression mode) The OK variable is set to 1 if the BLOB has been successfully compressed; otherwise, it is set to 0.
See also
|
PROPERTIES
Product: 4D HISTORY
Modified: 4D v6.5.3 TAGS Compression, blob compression ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||