compress

returns a gzip-compressed string.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

the compress of data

# Params

- data : A string of binary data of any length.

# Examples

compress(URL "file:image.pict")

put compress(field "Outgoing") into URL "binfile:data.gz"

# Description

Use the compress function to compress data to a smaller size for transmission.

The compressed result is typically about half to a third the size of the original data, although different results may be obtained depending on the amount of data and whether it has already been compressed.

>*Important:* The value return by the compress function > consists of binary file and may include control > characters, so displaying it on screen or trying to edit it may > produce unexpected results. If you use a URL to place the > return data in a file, it's important to use the > binfile URL scheme; using the file URL scheme will corrupt > binary file.

For technical information about the format used by the compress function, see [RFC 1952](https://tools.ietf.org/html/rfc1952). The compress function uses the zlib compression library.

# Tags

# See

- **keyword:** URL, inverse, file, binfile, string - **function:** compress, decompress - **glossary:** return, binary file - **control structure:** function