Spec-Zone.ru › ColdFusion

fileRead

Reads an on-disk or in-memory text file or a file object created with the FileOpen function.

fileRead(filePath [, charset | bufferSize]) → returns string

  • CF8+
  • Lucee
  • BL 1.0.0+
  • See Also: filewrite filereadline

    Argument Reference

    filePath any
    Required

    An absolute file path, or file object.

    charset any

    Character encoding used to read the file.

    bufferSize any

    The number of characters to read.

    Examples
    Sample code invoking the fileRead function

    Read a file into a variable

    Uses expandPath to grab a file in current directory.

    fileContent = fileRead(expandPath("./file.txt"), "utf-8")

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

    Spec-Zone.ru

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