extract

Extract the data of a compressed file.

extract(format, source, target) → returns boolean

This function requires Lucee. Not supported on Adobe ColdFusion.

extract Argument Reference

format string
Required

The format of the compressed file.
Values:
  • bzip
  • bzip2
  • tbz
  • tbz2
  • tar
  • tar.bz
  • tar.gz
  • gzip
  • tgz
  • zip

source string
Required

Path (relative or absolute) to the source-file or a directory with zip-files.

target string
Required

Path (relative or absolute) to the the directory, where you want to extract the data.

Examples sample code invoking the extract function


Extract a zip-file

Extract a zip-file and save the data in the "output-directory".

extract("zip", "test.zip", "output-directory")

Extract a multiple zip-files via a directory

Extract all zip-files, which are stored in the "multiple-directory" and save the data in the "output-directory".

extract("zip", "multiple-directory", "output-directory")

Fork me on GitHub