Last updated
Ortus Solutions, Corp
Last updated
CFML allows you to manipulate, read, upload, etc files via its built in methods which are great and easy to use. It can even help you manipulate zip/jar archives! We won't go into every single detail of file handling, but below you can find the majority of functions to deal with file handling.
You can find the file system functions here: .
Copies the contents of a directory to a destination directory.
Creates new directory for specified path
Deltes directory for given path
Determines whether a directory exists.
Lists the directory and returns the list of files under it as array or query
Renames given directory
Creates an absolute, platform-appropriate path that is equivalent to the value of relative_path, appended to the base path. This function (despite its name) can accept an absolute or relative path in the relative_path attribute
appends the entire content to the specified file.
Closes an file that is open.
Copies the specified on-disk or in-memory source file to the specified destination file.
Deletes the specified file on the server.
Determines whether a file exists
Returns the mimetype of the given file
returns detailed info about the given file.
Determines whether Lucee has reached the end of the file while reading it.
Moves file from source to destination
Opens an file to read, write, or append.
Reads an on-disk or in-memory text file or a file object created with the FileOpen function.
Reads a line from an file.
Shifts the file pointer to the given position. The file must be opened with seekable option
Sets the attributes of an on-disk file on UNIX or Linux. This function does not work with in-memory files.
For the given path, sets the file attributes.
For the given file, set the last modification date
Shifts the file pointer by the given number of bytes.
Touches given file, creates the file if not already exists.
Uploads file to a directory on the server.
Uploads file to a directory on the server.
If you specify a file path, writes the entire content to the specified file. If you specify a file object, writes text or binary data to the file object.
Opens up the file (or uses the existing file object) and appends the given line of text
Retrieves information about file.
Returns the number of unallocated bytes in the partition named by this abstract path name.
Returns the full path to the currently assigned temporary directory
Creates a temporary file in a directory whose name starts with (at most) the first three characters of prefix.
Writes a image to the specified filename or destination.
If you want to read or manipulate large files we would recommend that you leverage our library or native Java file streaming. Below you can find some sample usage of reading large files with which implements the Java Streams API.