Spec-Zone.ru › ColdFusion

compress

Compress a file or a directory with files.

compress(format, source, target [, includeBaseFolder] [, mode]) → returns boolean

  • Lucee
  • BL 1.0.0+
  • See Also: extract cfzip

    Argument Reference

    format string
    Required

    The format in which you want to compress the files.
    Values:
    • bzip
    • bzip2
    • tbz
    • tbz2
    • tar
    • tar.bz
    • tar.gz
    • gzip
    • tgz
    • zip

    source string
    Required

    Path (relative or absolute) to the file or directory you want to compress.

    target string
    Required

    Path (relative or absolute) including the name, where you want to save the compressed output-file.

    includeBaseFolder boolean
    Default: true

    Compress the directory or just the content of the directory.

    mode string
    Default: 777

    Examples
    Sample code invoking the compress function

    Compress a file

    Compress the file "example.txt" to a zip-file.

    compress("zip", "example.txt", "output.zip")

    Compress a directory

    Compress the "example-directory" to a zip-file.

    compress("zip", "example-directory", "output.zip")

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/compress

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API