Lucee Function Reference

compress()

Compress given source to different formats.

Example

compress(string format,string source,string target,[boolean includeBaseFolder,[string mode]]):boolean

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Default Value Description
format string  Yes   Formats to compress the files:
  • bzip
  • bzip2
  • gzip
  • tar
  • tbz (same as tar.bz)
  • tbz2
  • tgz (same as tar.gz)
  • zip  
  • source string  Yes   Path (relative or absolute) to source file or directory to compress.
    For **gzip / bzip / bzip2** (single file format) must use path including the name of the file  
    target string  Yes   Path (relative or absolute) including the name, where you want to save the compressed output-file  
    includeBaseFolder boolean  No true Compress the directory or just the content of the directory  
    mode string  No 777 Mode of the values